when I call
db.collection.remove({\'condition\':\'some condition\'});
This one line will delete all the matching condition documents.
For example the name of the db is 'abc' and under that there's a collection by name 'users' and users has an email which is 'test@test.com' which you want to remove: 1. On the terminal if you type 'show dbs' (without quotation' ') it would list all the databases including 'abc' 2. If you type 'use abc', it would switch to your desired db - abc (with the message: "switched to db abc") 3. Now if you type 'show collections', it would show all the collections including 'users' 4. If you want to list all the documents in this collection, you simply type: db.users.find({}) 5. If you want to delete a specific document in this collection, type: db.users.remove({"email":"test@test.com"})
If it's successful, it would display - WriteResult({ "nRemoved" : 1 })