mongodb delete document if key exists code example
Example 1: mongo delete all documents
db.bios.remove( { } )
Example 2: mango to delete a collection
db.CollectionName.drop()
db.bios.remove( { } )
db.CollectionName.drop()