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 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:

0/2000 characters
Ty
4 months ago
I thought all of them were valid options at first!
upvoted 0 times
...
Artie
4 months ago
Wait, D has a syntax error, right?
upvoted 0 times
...
Lura
4 months ago
C looks good, but it misses 200.
upvoted 0 times
...
Krystal
4 months ago
I think B is incorrect because it excludes 100.
upvoted 0 times
...
Julene
4 months ago
A is definitely the right choice!
upvoted 0 times
...
Jesusa
5 months ago
I’m confused about D; it looks like a typo with that extra ">" at the end. I hope that’s not an option!
upvoted 0 times
...
Leota
5 months ago
I practiced a similar question, and I feel like A is definitely the safest choice since it covers both ends.
upvoted 0 times
...
Katina
5 months ago
I'm not entirely sure, but I remember something about $gt and $lt not including the boundary values. So maybe C is correct?
upvoted 0 times
...
Emerson
5 months ago
I think option A is the right one because it uses both $gte and $lte, which means it includes 100 and 200.
upvoted 0 times
...
Margo
5 months ago
I'm leaning towards C. The $gte and $lt operators will give me the same result as A, but it might be a bit clearer to read.
upvoted 0 times
...
Johana
5 months ago
Option A looks good to me. The $gte and $lte operators will return the posts with likes between 100 and 200, including the endpoints. Can't go wrong with that.
upvoted 0 times
...
Celestina
5 months ago
Hmm, I'm a bit confused. I'm not sure if I should use $gte and $lte or $gt and $lt. I'll have to double-check the documentation to make sure I get this right.
upvoted 0 times
...
Salina
5 months ago
I think the answer is A. The query looks straightforward, using $gte and $lte to get the posts with likes between 100 and 200 inclusive.
upvoted 0 times
...
Garry
10 months 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
10 months ago
Option B seems to be the most straightforward approach. Why complicate it with inclusive ranges?
upvoted 0 times
Linn
9 months ago
User 3: Agreed, no need to complicate things with inclusive ranges.
upvoted 0 times
...
Janet
9 months ago
User 2: Yeah, it's simpler that way.
upvoted 0 times
...
Mike
9 months ago
User 1: I think option B is the correct one.
upvoted 0 times
...
...
Trevor
10 months 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
10 months 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
Marvel
9 months ago
User3: Yeah, Option C is the best choice for that query.
upvoted 0 times
...
Mammie
9 months ago
User2: I agree, $gte and $lt make it clear.
upvoted 0 times
...
Marshall
9 months ago
User1: I think Option C is the correct one.
upvoted 0 times
...
...
Ilene
11 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
10 months ago
Yes, option A is the right choice. It specifies the range correctly with $gte and $lte operators.
upvoted 0 times
...
Marylin
10 months ago
I think option A is correct too. It covers the range of likes we are looking for.
upvoted 0 times
...
...
Evangelina
11 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
11 months ago
I agree with Christene, option A makes sense because it includes both 100 and 200 in the range.
upvoted 0 times
...
Christene
11 months ago
I think the correct command is A) db.posts.find({ likes : { $gte : 100 , $lte : 200 } } );
upvoted 0 times
...

Save Cancel