• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

MongoDB Unset

Unset a field from Documents

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

{ “_id” : 1,
“domain” : “mkyong.com”,
“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” : “mkyong.com” }

For indepth understanding click on

Review Date
Reviewed Item
How to unset MongoDB?
Author Rating

“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 info@tekslate.com, 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 *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.