Index Overview

Index Creation Process

B-Tree and how index works


Default _id index with ObjectID

getIndexes()

Create new index – Which Fields should be added to the Index ?



Create Unique index

db.Persons.createIndex({index:1}, {unique: true})
//OUTPUT :
/* 1 */
{
"createdCollectionAutomatically" : false,
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"ok" : 1.0
}
Create index in background
This option is used in large collections on the live db
