Articles → MONGODB → Deletemany Function In Mongodb

Deletemany Function In Mongodb






Purpose





Example




Picture showing the list of documents in MongoDB
Click to Enlarge





db.Articles.deleteMany({subject:{$ne:”CSS”}})


Picture showing using deleteMany function in MongoDB
Click to Enlarge


Output


Picture showing the list of documents after using deleteMany function in MongoDB
Click to Enlarge


Deleting All Documents From The Collections




db.[collection_name].deleteMany({})



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, February 7, 2023
 
Updated On  -  Monday, April 8, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250