Hi, can you try updatijng it to {“trip_members”: "%%user.custom_data.id"}. I believe you have two issues.
You have a space in this string " %%user.custom_data.id"
There is no need to use $all for an array with a single element, just use the basic ANY approach which is much much easier to express as {“trip_members”: "%%user.custom_data.id"}
About the syntax issue, I did fix it but the issue actually came from the following:
creator_id was stored as ObjectId in my schema.
Looking at add-collaborators sample application in your docs, I realised that examples of owner_id actually uses string. So I am assuming that %%user.id is expanding into a string? When I switched to checking with string fields, it works.
“email” : “%%user.custom_data.email"
Then, what would be the best practice?
Introducing redundant field: creator_id is user._id.toString()
Using another queryable field, such as email, and using Array<String> instead of Array<ObjectId>