I don't think you have to put the whole object, you can set individual properties of one of the elements using a double search param and place the '$set' on the field itself:
using your example above, something like:
db.yourCollection.update({ _id: ObjectId("5b0bf696cb5dd80010bea0a3"), 'emails._id': ObjectId("5b0bf696cb5dd80010bea0a5") }, {'$set': {'emails.$.Email': 'w.white@break.bad'}})
Good to read that '$pull' will remove an element, note that '$push' will add an element
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't think you have to put the whole object, you can set individual properties of one of the elements using a double search param and place the '$set' on the field itself:
using your example above, something like:
Good to read that '$pull' will remove an element, note that '$push' will add an element