Articles → MONGODB → Compound Index In MongodbCompound Index In MongodbThis article describes the compound index in MongoDB.Definition A compound index is an index made up of multiple fields.Syntax db.collection.createIndex( { field1: 1, field2: -1 } );Example Posted By - Karan Gupta Posted On - Thursday, April 25, 2024 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
db.collection.createIndex( { field1: 1, field2: -1 } );
Query/Feedback