New Year Sale 2026! 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 1 Question 109 Discussion

Actual exam question for MongoDB's C100DBA exam
Question #: 109
Topic #: 1
[All C100DBA Questions]

Consider that our posts collection contains an array field called tags that contains tags that the user enters. {

Which of the following commands will find all the posts that have been tagged as tutorial.

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Ciara
2 months ago
I thought tags were always arrays, so A should work, right?
upvoted 0 times
...
Gabriele
3 months ago
C is the only one that makes sense here.
upvoted 0 times
...
Isaiah
3 months ago
I think A looks correct too, but I’m not sure.
upvoted 0 times
...
Eleonore
3 months ago
Wait, are we sure D is even a valid command?
upvoted 0 times
...
Armando
3 months ago
Option C is definitely the right choice!
upvoted 0 times
...
Cherelle
3 months ago
Option B seems off with the syntax, and I don't think `$array` is a valid operator in MongoDB. I’m leaning towards C as well.
upvoted 0 times
...
Veronika
4 months ago
I'm a bit confused about option A; I feel like it should be using the `$elemMatch` operator or something like that, but I can't recall the exact details.
upvoted 0 times
...
Adaline
4 months ago
I remember practicing a similar question where we had to find items in an array, and I think using just the tag name like in option C is correct.
upvoted 0 times
...
Willodean
4 months ago
I think option C looks familiar, but I'm not entirely sure if it’s the right syntax for querying an array.
upvoted 0 times
...
Ma
4 months ago
I'm not too familiar with MongoDB, so this type of question is a bit tricky for me. I'll have to think through the array syntax carefully and review the options before making a decision.
upvoted 0 times
...
Judy
4 months ago
Okay, I got this. The key is that the tags field is an array, so we need to use the correct syntax to query for a specific value in the array. I'm pretty sure option C is the right answer here.
upvoted 0 times
...
Bernadine
5 months ago
Hmm, I'm a bit confused by the array field in the question. I'm not sure if we need to use a special query to search for a value within an array. Maybe I should review the MongoDB array query syntax before answering.
upvoted 0 times
...
Audria
5 months ago
This looks like a straightforward MongoDB query question. I think the answer is C, since the tags field is an array and we want to find all posts that have the 'tutorial' tag.
upvoted 0 times
...
Glendora
10 months ago
Wait, 'tutorial' is a tag, not a tutorial. This test is testing my sanity, not my MongoDB skills.
upvoted 0 times
Merissa
10 months ago
Wait, 'tutorial' is a tag, not a tutorial. This test is testing my sanity, not my MongoDB skills.
upvoted 0 times
...
Cyndy
10 months ago
A) db.posts.find( { tags : [\'tutorial\'] } );
upvoted 0 times
...
...
Gerald
10 months ago
B) db.posts.find( { $array : {tags: tutorial}) > is just plain weird. What is this, JavaScript land? I'll stick with good old C).
upvoted 0 times
...
Gilma
10 months ago
I think D is definitely wrong, it doesn't look like a valid command.
upvoted 0 times
...
Stefanie
11 months ago
I'm not sure, but C could also be a possibility.
upvoted 0 times
...
Lorita
11 months ago
D) db.posts.findInArray( { tags : tutorial > ); sounds like it should work, but I've never heard of that command. Is that some secret MongoDB technique?
upvoted 0 times
...
Luis
11 months ago
A) db.posts.find( { tags : [tutorial] } ); is the way to go. Gotta love that array matching!
upvoted 0 times
Jonell
9 months ago
User2: Thanks for the clarification, I'll keep that in mind for future queries.
upvoted 0 times
...
Nana
9 months ago
User3: User1 is right, A) is the correct command for finding posts with the 'tutorial' tag.
upvoted 0 times
...
Tyisha
9 months ago
User2: C) db.posts.find( { tags : 'tutorial' } ); is also a valid option.
upvoted 0 times
...
Fletcher
10 months ago
User1: A) db.posts.find( { tags : [tutorial] } ); is the way to go. Gotta love that array matching!
upvoted 0 times
...
Lashon
10 months ago
User2: Thanks for the clarification, I'll keep that in mind for future queries.
upvoted 0 times
...
Jennie
10 months ago
User3: User1 is right, A) is the correct command for finding posts with the 'tutorial' tag.
upvoted 0 times
...
Talia
10 months ago
User2: C) db.posts.find( { tags : 'tutorial' } ); is also a valid option.
upvoted 0 times
...
Timothy
10 months ago
User1: A) db.posts.find( { tags : [tutorial] } ); is the way to go. Gotta love that array matching!
upvoted 0 times
...
...
Corrie
11 months ago
I agree with Thea, A seems correct.
upvoted 0 times
...
Mindy
11 months ago
C) db.posts.find( { tags : tutorial } ); is the correct answer. It's a simple and straightforward way to query for posts with the 'tutorial' tag.
upvoted 0 times
Kassandra
10 months ago
Great, thanks for clarifying!
upvoted 0 times
...
Veronika
10 months ago
C) db.posts.find( { tags : \'tutorial\' } ); is the correct answer.
upvoted 0 times
...
Stephane
10 months ago
A) db.posts.find( { tags : [\'tutorial\'] } );
upvoted 0 times
...
...
Thea
11 months ago
I think the answer is A.
upvoted 0 times
...

Save Cancel