Suposse tou have the following collection with only 2 documents:
If you run an aggregation query and use { $unwind: "$traits" } as the first stage, how many documents will be passed to the next stage of the aggregation pipeline?
I agree with the answer is 4. Each document in the collection will be duplicated for every element in the 'traits' array, resulting in 4 documents in total.
I'm not sure, but I think the answer is 2. The $unwind stage will create a document for each element in the 'traits' array, resulting in a total of 2 documents.
I disagree, I believe the answer is 4. The $unwind stage will create a document for each element in the 'traits' array but it will maintain the original document as well.
Giovanna
6 months agoVenita
6 months agoLuis
7 months agoMatthew
7 months agoNidia
8 months agoAdolph
8 months agoNidia
8 months agoAdolph
8 months ago