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 5 Question 106 Discussion

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

Which of the following commands will return all the posts with number of likes greater than 100 and less than 200, both inclusive?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Garry
18 days ago
If I was a post with 100 likes, I'd be offended to be excluded from this query. Gotta love those inclusive ranges!
upvoted 0 times
...
Geoffrey
21 days ago
Option B seems to be the most straightforward approach. Why complicate it with inclusive ranges?
upvoted 0 times
...
Trevor
26 days ago
Ha! Option D is a classic trick question. The greater than and less than symbols should be outside the curly braces.
upvoted 0 times
...
Wei
27 days ago
I think Option C is the way to go. It's more explicit about the inclusive range with $gte and $lt.
upvoted 0 times
...
Ilene
2 months ago
Option A looks like the correct one to me. It uses the $gte and $lte operators to get posts with likes between 100 and 200, inclusive.
upvoted 0 times
Freida
13 days ago
Yes, option A is the right choice. It specifies the range correctly with $gte and $lte operators.
upvoted 0 times
...
Marylin
18 days ago
I think option A is correct too. It covers the range of likes we are looking for.
upvoted 0 times
...
...
Evangelina
2 months ago
I'm not sure, but I think option C might also work because it uses $lt for less than 200.
upvoted 0 times
...
Kayleigh
2 months ago
I agree with Christene, option A makes sense because it includes both 100 and 200 in the range.
upvoted 0 times
...
Christene
2 months ago
I think the correct command is A) db.posts.find({ likes : { $gte : 100 , $lte : 200 } } );
upvoted 0 times
...

Save Cancel