db.collection.ensureIndex()
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoDB server.
Note
Removed in 5.0
db.collection.ensureIndex()
has been replaced by
db.collection.createIndex()
.