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 Exam C100DBA 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:

Glendora
24 days ago
Wait, 'tutorial' is a tag, not a tutorial. This test is testing my sanity, not my MongoDB skills.
upvoted 0 times
Cyndy
10 days ago
A) db.posts.find( { tags : [\'tutorial\'] } );
upvoted 0 times
...
...
Gerald
25 days 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
26 days ago
I think D is definitely wrong, it doesn't look like a valid command.
upvoted 0 times
...
Stefanie
29 days ago
I'm not sure, but C could also be a possibility.
upvoted 0 times
...
Lorita
29 days 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
1 months ago
A) db.posts.find( { tags : [tutorial] } ); is the way to go. Gotta love that array matching!
upvoted 0 times
Lashon
2 days ago
User2: Thanks for the clarification, I'll keep that in mind for future queries.
upvoted 0 times
...
Jennie
5 days ago
User3: User1 is right, A) is the correct command for finding posts with the 'tutorial' tag.
upvoted 0 times
...
Talia
8 days ago
User2: C) db.posts.find( { tags : 'tutorial' } ); is also a valid option.
upvoted 0 times
...
Timothy
11 days ago
User1: A) db.posts.find( { tags : [tutorial] } ); is the way to go. Gotta love that array matching!
upvoted 0 times
...
...
Corrie
1 months ago
I agree with Thea, A seems correct.
upvoted 0 times
...
Mindy
1 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
6 days ago
Great, thanks for clarifying!
upvoted 0 times
...
Veronika
7 days ago
C) db.posts.find( { tags : \'tutorial\' } ); is the correct answer.
upvoted 0 times
...
Stephane
9 days ago
A) db.posts.find( { tags : [\'tutorial\'] } );
upvoted 0 times
...
...
Thea
1 months ago
I think the answer is A.
upvoted 0 times
...

Save Cancel