Docs Menu

Docs HomeDevelop ApplicationsMongoDB Manual

db.collection.ensureIndex()

db.collection.ensureIndex(keys, options)

Note

Removed in 5.0

db.collection.ensureIndex() has been replaced by db.collection.createIndex().

Tip

←  db.collection.dropIndexes()db.collection.estimatedDocumentCount() →