Articles → MONGODB → Compound Index In MongodbCompound Index In MongodbIn this article, we will discuss the compound index in MongoDB.Definition A compound index is an index that consists 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