logo

Crowdly

Browser

Add to Chrome

Jane wants to create two collections in MongoDB called the  parent  collection ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Jane wants to create two collections in MongoDB called the parent collection and the child collection. The relationship between the two collections is one-to-many. One document in the parent collection has many related documents in the child collection. She has written the following aggregation query.

db.parent.aggregate([

            {$unwind:"$myArray"},

            {$lookup:

                  { from: "child", 

                        localField: "myArray",

                        foreignField: "_id",   

                        as: "myArrayDetail"}   

                  }])

What kind of join is $lookup?

0%
0%
100%
0%
More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome