I have one collection for users, one for user's calendars, (users:calendars have 1:1 relation, but not all user owns a calendar):
users: {"name":"John","role":admin [more fields]}
calendars: {"color":"blue",owner: "users/john"}
I've to return a document with:
{"name":"John","role":admin,[all fields from the users collection],calendar:cal}
Is there a way to do this without listing the properties from the user document?
for cal in zcalendar
for user in zuser filter user._id == cal.owner
return ...
You can use MERGE document function, e.g. like this:
Which returns this structure: