Hello dear community,
I have a problem with my code and I hope you can help me. Here is the context:
I have a database called Sessions in which I need to update a column in the afterInsert hook (I do it in the afterinsert because the column uses the ID and you can’t use ID in beforeInsert).
Here is my code :
export async function Sessions_afterInsert(item, context) {
item.urlCatalogue = await defineUrlCatalogue(item);
let options = {
"suppressAuth": true,
"suppressHooks": true
};
wixData.update("Sessions", item, options)
.then((results) => {
item = results;
});
return item;
}
The code works and the column is updated but I have an error that I don’t like in the logs :
[“Data inserted contains field name prefixed with symbol ‘$’. It is not recommended to use such field names as it will not work with some data operations.”]
I tried to only call update (without modifying item.urlCatalogue) and the result is the same.
I tried also to display in JSON all the fields of my item and I did not see any ‘$’ anywhere (except for the dates which appear with a $date in JSON).
Have you seen this error before? Should I ignore it?
Thank you in advance for your help !