MongoDB $lookup with arrays


#1

Hey,
I’m just trying to do a join within a Meteor method to send some none reactive data to our client.

For example, I’m having the following data structure:

{
 name: 'My Playlist',
 videos:[
 {videoId:1},
 {videoId:2}]
}

Now I want to do a $lookup for every single video object. At the end, I want this data structure:

{
 name: 'My Playlist',
 videos:[
 {videoId:1, videoDetails:[{url:'http://...', _id:1, title:'Hello...'}}],
 {videoId:2, videoDetails:[{url:'http://...', _id:1, title:'Hello...'}}]]
}

Is this currently possible with the $lookup aggregate function?