db.users.getIndexes()

Category: Databases & SQL

db.users.getIndexes()

List a collection's indexes

Shows every index definition, including the automatic _id index that cannot be dropped. Useful before creating or removing indexes. Related: createIndex, dropIndex.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.