In this lab you're going to determine which queries are able to successfully use a given index for both filtering and sorting. Given the following index: {"first_name": 1, "address.state": -1, "address.city": -1, "ssn": 1} Which of the following queries are able to use it for both filtering and sorting? Check all that apply: Answer: db.people.find({ "first_name": { $gt: "J" } }).sort({ "address.city": -1 }) - No - This query doesn't use equality on the index prefix. When using an index for filtering and sorting the query must include equality conditions on all the prefix keys that precede the sort keys. Moreover, on the sort predicate it skipped the next key in the prefix "address.state". db.people.find({ "first_name": "Jessica" }).sort({ "address.state": 1, "address.city": 1 }) - Yes . This query matches with equality on the query predicate wit...
Thanks for sharing this blog post,Nice written skill core Java online training
ReplyDeletePost is simply superb. Thanks for posting.
ReplyDeleteFull Stack online Training
Full Stack Training
Full Stack Developer Online Training
Nice Blog With Full of Knowledge Thanks For Sharing...
ReplyDeleteMean stack online training
Mean stack training in hyderabad
ReplyDeleteGreat post.Thanks for sharing such a worthy information...
SEO Training in Bangalore
SEO Course in Bangalore
SEO Training Institute in Bangalore
Best SEO Training Institute in Bangalore
SEO Training Bangalore
ReplyDeleteGreat Content, Thanks for sharing useful information with us.
PHP Course in Chennai
PHP Online Certification Training
PHP Course in Bangalore