Docs Menu

Docs HomeMongoDB 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() →
Share Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.