Articles → MONGODB → $Unset Operator In Mongodb$Unset Operator In MongodbIn this article, we will discuss the $unset operator in MongoDB.Purpose The $unset operator is used in update operations to remove a specific field from a document.Example Consider the following collection: -The requirement is to remove the age field from the collection. For that, we will execute the following query: -db.Employees.updateMany({}, {$unset:{age:""}})Output Posted By - Karan Gupta Posted On - Tuesday, March 19, 2024 Query/Feedback Your Email Id Subject Query/Feedback Characters remaining 250
db.Employees.updateMany({}, {$unset:{age:""}})
Query/Feedback