Docs Menu
Docs Home
/
MongoDB 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

See also:

Back

db.collection.dropIndexes()