MongoDB
 SQL >> Database >  >> NoSQL >> MongoDB

Ottimizzare query MongoDB lente con indici compound

Crea un indice compound che supporti selettività e ordinamento.

db.collection.createIndex(
  {
    "property.multi.value_title": 1,
    field: "text",
    "pricing.price": 1
  },
  { default_language: "spanish" }
);