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 8 Question 130 Discussion

What is the equivalent command in MongoDB for the following SQL query?SELECT * FROM posts WHERE author like "%john%"
A) db.posts.find( { author: /John/ } )
B) db.posts.find( { author: /AjohnA/ > )
C) db.posts.find( { $like: {author: /John/} } )
D) db.posts.find( { author: {$like: /John/} } )

MongoDB C100DBA Exam - Topic 8 Question 130 Discussion

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

What is the equivalent command in MongoDB for the following SQL query?

SELECT * FROM posts WHERE author like "%john%"

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Myong
3 days ago
A is definitely the best choice. Others are incorrect.
upvoted 0 times
...
Phung
8 days ago
Agreed, A makes sense. Regex for matching.
upvoted 0 times
...
Jennie
14 days ago
I think it's A. Looks right.
upvoted 0 times
...
Noah
19 days ago
C and D are definitely wrong.
upvoted 0 times
...
Kristeen
24 days ago
B doesn't even make sense.
upvoted 0 times
...
Truman
29 days ago
Wait, are we sure about A?
upvoted 0 times
...
Yan
1 month ago
I think A is the only valid option here.
upvoted 0 times
...
Solange
1 month ago
A is correct!
upvoted 0 times
...
Edelmira
1 month ago
I’m leaning towards A too, but I’m confused about whether the case sensitivity of the regex matters in this case.
upvoted 0 times
...
Gabriele
2 months ago
I feel like options C and D are definitely wrong because MongoDB doesn't use a $like operator.
upvoted 0 times
...
Lonny
2 months ago
I remember practicing a similar question, and I think the correct syntax for regex in MongoDB is important here.
upvoted 0 times
...
Van
2 months ago
I think the answer might be A, but I'm not entirely sure about the regex part.
upvoted 0 times
...

Save Cancel