Articles → MONGODB → Updatemany Function In MongoDB

Updatemany Function In MongoDB






Purpose





Example




Picture showing the list of documents in MongoDB




db.Articles.updateMany(
    { subject: { $ne: "css" } },
    { $set: { subject: "No Subject" } }
)


Picture showing using updateMany function in MongoDB



Output


Picture showing the list of documents after using updateMany function in MongoDB





Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, February 7, 2023

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250