I haven’t tested but could you try with $uwnind operator, it will deconstructs an array field from the input documents to output a document with the value of the array field replaced by the element.
Please keep the community posted, we’ll be happy to help.
Note: In case of further help please share the sample document, the aggregation query you tried, and the resultant output you expect.
I’m not allowed to add attachement as I’m a new user. You’ll find a small sample of user.data and project collection add the end of this post.
I think my previous post may be a bit misleading. I’m using Atlas App services (mongo realm) and realm SDK on react-native side.
The App use CustomJWTProvider (https://www.mongodb.com/docs/atlas/app-services/authentication/custom-jwt/) to log into my App Services application and the JWT payload contains some information on projects (small array of ObjectId) that should be provided to the application.
I still tried the following two possibilities, that are probably wrong, without success (no results are returned, no errors are returned in the app and in the AppService logs)