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