Consider the following document from the products collection: { _id: 1, product_code: "1234", variations: [ { size: "L", price: 1000 }, { size: "M", price: 800 } ] } What does the following query using $elemMatch return? db.products.find( { product_code: "1234" }, { variations: { $elemMatch: { size: "L" } } } )
Correct Answer: Returns the document but with only one element in the variations array (corresponding to size L)
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More MongoDB MCQ Questions