Given the following indexes: { categories: 1, price: 1 } { in_stock: 1, price: 1, name: 1 } The following documents: { price: 2.99, name: "Soap", in_stock: true, categories: ['Beauty', 'Personal Care'] } { price: 7.99, name: "Knife", in_stock: false, categories: ['Outdoors'] } And the following queries: db.products.find({ in_stock: true, price: { $gt: 1, $lt: 5 } }).sort({ name: 1 }) db.products.find({ in_stock: true }) db.products.find({ categories: 'Beauty' }).sort({ price: 1 }) Whic h of following is/are true? Answer: Index #1 would provide a sort to query #3. - True Index #2 properly uses the equality, sort, range rule for query #1. - False - If we were to build an index for query #1 using the equality, sort, range rule, then the index would be: { in_stock: 1, name: 1, price: 1 }. There would be a total of 4 index keys created across all of these documents and indexes. - False - As there would be 5 to
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