Skip to content

Instantly share code, notes, and snippets.

@Abhinay-g
Created May 5, 2019 15:42
Show Gist options
  • Select an option

  • Save Abhinay-g/74f8114a023ff1dd32841fb4c81db168 to your computer and use it in GitHub Desktop.

Select an option

Save Abhinay-g/74f8114a023ff1dd32841fb4c81db168 to your computer and use it in GitHub Desktop.
MongoDB Delete
Delete one or many items from collection > db.collection.deleteOne/deleteMany(--findCondition--)
Delete Collection > db.collection.deleteMAny({})
Delete Entire Collection [Admin task] >>>> db.collection.drop()
Delete entire Database [Admin TAsk] >>>> db.deleteDatabase()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment