Skip to content

Instantly share code, notes, and snippets.

@stephencweiss
Last active November 21, 2018 19:58
Show Gist options
  • Save stephencweiss/aab22217b5698f7cba0086adb9c98b2d to your computer and use it in GitHub Desktop.
Save stephencweiss/aab22217b5698f7cba0086adb9c98b2d to your computer and use it in GitHub Desktop.
Mongo dropIndex() example with and without index name.
// mongo sh
> db.descriptions.dropIndex("product_id_1")
{ "nIndexesWas" : 2, "ok" : 1 }
> db.descriptions.dropIndexes()
{
"nIndexesWas" : 2,
"msg" : "non-_id indexes dropped for collection",
"ok" : 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment