0 votes
in MongoDB by
In our posts collection, which of following command can be used to find all the posts whose author names begin lie between �A� and �C� in dictionary order?

A - db.posts.find( { post_author : { $gte : "A" , $lte : "C" } } );

B - db.posts.find( { post_author : { $gte : "C" , $lte : "A" } } );

C - db.posts.find( { post_author : { $gt : "A" , $lt : "C" } } );

D - This type of search is not supported by MongoDB. $lt and $gt operators are applicable only for numeric values.

1 Answer

0 votes
by
Correct Ans is A

A - db.posts.find( { post_author : { $gte : "A" , $lte : "C" } } );
...