}
I would like to keep the change in the query when I return the item. I’m not really sure why it go through the code but when it returns, it is undefined. Can someone help me with this?
I can’t use the code provided. The multi-reference field won’t save if I treat it as a normal array. Although it says “all changes saved”, the change will disappear if I close the view of the collection and reopen it. I’m using insert reference instead but it’s working half of the times. Also, I can’t use remove referen/ce because it will run out of time quota.
Yes, this was just an example to make it possible to show you all the console-logs, on your front-end. This way you also get all the logs on front-end, without using the BACKEND-TEST-ENVIRONMENT to test your BACKEND-CODE.
Did you got some results on FRONT-END ?
Use these results to generate your → resulted item-object ←
Now you should see better what you are doing and which results you get back.
The more you see whats happening → the faster you will get your final result.
A simple technique, which will help you to code faster on BACKEND.
And yes you will have to use → item <— and returning its modified version back to frondend.
Simple example…
…bla bla bla code
…bla bla bla code
…bla bla bla code
.find()
.then( async (res)=>{
//defining → “items”
let items = res.items;
//start of ITEM-MODIFICATION.....--> **DIRECT-MODIFICATION**
items[0].title = "xxxxxxxxx";
items[1].title = "yyyyyyyy";
items[2].title = "zzzzzzzzz";
//...in your case --> you have another function running first.....
// ---> **INDIRECT-MODIFICATION --> calling a further function (wait first for a further process)....**
console . log ( "workshops: " + results . items [ 0 ]. title )
let modifiedItems = **await** items . map ( **function** get_ids ( i ){ i . _id });
console.log("Modified-Items: ", modifiedItems );
//end of ITEM-MODIFICATION...
}).catch(…
…bla bla bla code
…bla bla bla code
…bla bla bla code