Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

MongoDB C100DBA Exam - Topic 7 Question 131 Discussion

Posted by Diane on Jun 29, 2026 at 08:48 PM

Consider the following document from the products collection:

What does the following query using $elemMatch return? db.products.find( { product_code: "345678" }, { variations: { $elemMatch: { size: ^L^ } } } )

Suggested Answer: B

Get Premium C100DBA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
21 comments · newest first
MA
Maurine 2 days ago
I think it's B.
LI
Lilli 7 days ago
I hope I get this right!
MO
Mozell 12 days ago
Agreed, B makes sense for clarity.
WA
Walton 17 days ago
Still, B is the most straightforward answer.
SE
Serina 22 days ago
But D includes size field retrieval.
LI
Lilli 28 days ago
D is too complicated. Just one element is enough.
JA
Jackie 1 month ago
C seems wrong. It retrieves specific fields.
MO
Mozell 1 month ago
A doesn't limit the array though.
SE
Serina 1 month ago
I feel like it could be A too.
WA
Walton 2 months ago
It matches size L, so only that variation shows up.
JA
Jackie 2 months ago
Why B?
WA
Walton 2 months ago
I think it's B.
DE
Denae 2 months ago
A is misleading, it doesn't just retrieve the size field.
CA
Carry 2 months ago
C is incorrect, it can return specific elements!
TE
Terrilyn 2 months ago
Wait, does MongoDB really not support partial array retrieval?
BO
Bobbye 3 months ago
Definitely B! Makes the most sense.
RE
Rebbeca 3 months ago
I think it returns the document with just one variation for size L.
AU
Audrie 3 months ago
I feel like option D might be the right choice since it mentions retrieving the size field and only one element, which seems to align with how $elemMatch works.
BE
Becky 3 months ago
I’m a bit confused about whether MongoDB allows partial retrieval of arrays. I thought it did, but I could be wrong.
CL
Claribel 3 months ago
I remember practicing a similar question where $elemMatch was used, and it returned only the matching elements from the array. So, I’m leaning towards option B.
DO
Dorathy 4 months ago
I think the query is supposed to return the document with just the matching variation, but I'm not entirely sure if it includes the whole document or just part of it.
0/2000 characters

Save Cancel