delete all records from table mongodb code example
Example 1: mongodb delete all documents
db.collection.delete_many( { } );
Example 2: find All and delete in mongodb
db.products.remove( { qty: { $gt: 20 } } )
db.collection.delete_many( { } );
db.products.remove( { qty: { $gt: 20 } } )