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
2 hours ago
Wait, 'tutorial' is a tag, not a tutorial. This test is testing my sanity, not my MongoDB skills.
upvoted 0 times
...
Gerald
1 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
2 days ago
I think D is definitely wrong, it doesn't look like a valid command.
upvoted 0 times
...
Stefanie
5 days ago
I'm not sure, but C could also be a possibility.
upvoted 0 times
...
Lorita
5 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
7 days ago
A) db.posts.find( { tags : [tutorial] } ); is the way to go. Gotta love that array matching!
upvoted 0 times
...
Corrie
11 days ago
I agree with Thea, A seems correct.
upvoted 0 times
...
Mindy
19 days 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
...
Thea
19 days ago
I think the answer is A.
upvoted 0 times
...

Save Cancel