Cyber Monday 2024! 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 103 Discussion

Actual exam question for MongoDB's C100DBA exam
Question #: 103
Topic #: 1
[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:

Verda
5 days ago
Option C looks like it's trying to be clever, but the $like operator is SQL, not MongoDB. A is the way to go, no doubt about it.
upvoted 0 times
...
Shawana
6 days ago
Hmm, I wonder if the exam writers are just trying to trick us with these other options. A is the only one that makes sense to me.
upvoted 0 times
...
Eric
7 days ago
I was going to say option B, but then I remembered that /AjohnA/ is not a valid regular expression. A is the clear winner here.
upvoted 0 times
...
Marsha
12 days ago
I'm not sure, but I think it's either A) or D). Let me check the MongoDB documentation to confirm.
upvoted 0 times
...
Rebbecca
12 days ago
Option D seems like it should work, but the $like operator doesn't exist in MongoDB. A is the way to go for sure.
upvoted 0 times
...
Alfred
19 days ago
I agree with Grover, because using /John/ in MongoDB is equivalent to LIKE '%john%' in SQL.
upvoted 0 times
...
Ilona
19 days ago
I agree, option A is the way to go. MongoDB's query language is much more concise and powerful than SQL.
upvoted 0 times
...
Arminda
21 days ago
Option A looks correct, it uses the regex search operator to find posts where the author field contains 'John'.
upvoted 0 times
Maira
7 days ago
That makes sense, it's using the regex operator to search for 'John' in the author field.
upvoted 0 times
...
Hoa
8 days ago
A) db.posts.find( { author: /John/ } )
upvoted 0 times
...
...
Grover
25 days ago
I think the answer is A) db.posts.find( { author: /John/ } )
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77