delete mongo code example
Example 1: mongodb remove all from collection
db.collection.remove({})
Example 2: deletemany mongodb
try {
db.orders.deleteMany( { "client" : "Crude Traders Inc." } );
} catch (e) {
print (e);
}
Example 3: mongo delete all documents
db.bios.remove( { } )
Example 4: delete collection mongodb
db.collection.drop()