mongodb delete all collection code example
Example 1: delete collection mongodb
db.collection.drop()
Example 2: mongo remove all tables
mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})'
db.collection.drop()
mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})'