1.

What authorization model does MongoDB follow?

Answer»
  • Compound indexes not only support queries that match all the INDEX FIELDS, they also support queries on the index PREFIXES as well.

Consider the following compound index

{ "accountHolder": 1, "accountNumber": 1, "currency": 1 }

The index prefixes are

                      { accountHolder: 1 }                      { accountHolder: 1, accountNumber: 1 }

Query plan will USE this index if the query has the following fields

  • accountholder
  • accountHolder and  accountNumber
  • accountholder and accountNumber and currency
  • Ordering is very IMPORTANT, the order of fields in the queries should match the order of fields in a compound index (left to right) for the index to be used


Discussion

No Comment Found