mongosh appdb --eval 'db.users.dropIndex({email: 1})'

Category: Databases & SQL

mongosh appdb --eval 'db.users.dropIndex({email: 1})'

Drop an index from a collection

Removes the index on email, freeing space and write overhead. Queries that relied on it fall back to collection scans until a replacement exists. Dropping the _id index is not allowed.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.