Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create index mongodb

//Create a Single-Key Index if All Queries Use the Same, Single Key
db.products.createIndex( { "category": 1 } )
// Create Compound Indexes to Support Several Different Queries
db.products.createIndex( { "category": 1, "item": 1 } )
//Index Use and Collation
db.myColl.createIndex( { category: 1 }, { collation: { locale: "fr" } } )
Source by www.mongodb.com #
 
PREVIOUS NEXT
Tagged: #create #index #mongodb
ADD COMMENT
Topic
Name
5+5 =