In our posts collection, which command can be used to find all the posts whose author names begin lie between \"A\" and \"C\" in dictionary order?
- db.posts.find( { post_author : { $gte : \"A\" , $lte : \"C\" } } );
- db.posts.find( { post_author : { $gte : \"C\" , $lte : \"A\" } } );
- db.posts.find( { post_author : { $gt : \"A\" , $lt : \"C\" } } );
- This type of search is not supported by MongoDB. $lt and $gt operators are applicable only for numeric values.
Correct Answer:
A.db.posts.find( { post_author : { $gte : "A" , $lte : "C" } } );
need an explanation for this answer? contact us directly to get an explanation for this answer