MongoDB - Covered Queries

MongoDB - Covered Queries

What is a Covered Query?

As in step with the reputable MongoDB documentation, a included query is a question in which
  • All the fields in the query are part of an index.
  • All the fields back inside the question are in the same index.

Since all the fields gift inside the question are part of an index, MongoDB matches the query conditions and returns the result the usage of the identical index with out really looking inside the files.

Using Covered Queries

To test protected queries, take into account the subsequent file in the customers collection

    "_id": ObjectId("12544454545454587"),
    "touch": "987654321",
    "dob": "01-06-1984",
    "gender": "F",
    "name": "Anglina",
    "user_name": "anglina58"
Now, this index will cover the following query
MongoDB could not cross looking into database files.

Welookups is optimized for learning.Copy right 2018 - 2019 kumar aditya singh .
All Right Reserved and you agree to have read and accepted our term and condition.
All Rights Reserved.