In this lesson, I will show you how to delete single or multiple documents from the collection of the MongoDB database.
Syntax:
db.collection.remove(condition, just_one)
Example:
db.employees.remove({email: 'tamim@gmail.com'})
Delete Just One Row:
db.employees.remove({salary: {$lt: 800}}, 1)
Delete all documents (SQL's truncate):
db.employees.remove({})