In MongoDB, the dropIndexes()
method allows you to drop one or more indexes from a collection.
To drop a single index, pass the name of the index or its definition/specification document. If it’s a text index, you can only specify the index name.
To drop multiple indexes, pass the index names in an array.
To drop all indexes (except for the _id
index), don’t pass any arguments.