What is the equivalent command in MongoDB for the following SQL query?
SELECT * FROM posts WHERE author like "%john%"
Suggested Answer: A
Get Premium C100DBA Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
12 comments · newest first
MY
Myong
3 months ago
A is definitely the best choice. Others are incorrect.
PH
Phung
3 months ago
Agreed, A makes sense. Regex for matching.
JE
Jennie
3 months ago
I think it's A. Looks right.
NO
Noah
4 months ago
C and D are definitely wrong.
KR
Kristeen
4 months ago
B doesn't even make sense.
TR
Truman
4 months ago
Wait, are we sure about A?
YA
Yan
4 months ago
I think A is the only valid option here.
SO
Solange
4 months ago
A is correct!
ED
Edelmira
4 months ago
I’m leaning towards A too, but I’m confused about whether the case sensitivity of the regex matters in this case.
GA
Gabriele
5 months ago
I feel like options C and D are definitely wrong because MongoDB doesn't use a $like operator.
LO
Lonny
5 months ago
I remember practicing a similar question, and I think the correct syntax for regex in MongoDB is important here.
VA
Van
5 months ago
I think the answer might be A, but I'm not entirely sure about the regex part.