mongodb remove all code example
Example 1: mongodb remove all from collection
db.collection.remove({})
Example 2: mongo remove all dbs
mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})'
Example 3: mongo delete all documents
db.bios.remove( { } )
Example 4: delete collection mongodb
db.collection.drop()
Example 5: delete an item from db collection mongodb
db.collection.remove(
,
{
justOne: ,
writeConcern:
}
)