Group Discounts available for 3+ students and Corporate Clients

MongoDB Unset

Unset a field from Documents

Sample of document, and you want to unset the field “affLink”.

{ “_id” : 1,
“domain” : “”,
“affLink” : “abc” }
Interested in mastering Mongo DB Training?
Enroll now for FREE demo on Mongo DB Training.

To unset a field from all documents, set {multi: true}, else only the field of the first matched document will be removed.

db.domain.update({},{$unset: {affLink:1}},{multi: true});


{ “_id” : 1, “domain” : “” }

For indepth understanding click on

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at, we will update the article in 24 hours.”

0 Responses on MongoDB Unset"

Leave a Message

Your email address will not be published. Required fields are marked *


Please Enter Your Details and Query.
Three + 6