Updating multiple fields using update query
In other words, a target row shouldn't join to more than one row from the other table(s).
If it does, then only one of the join rows will be used to update the target row, but which one will be used is not readily predictable.
If only one field of a document should be updated the "$set" operator can be used.
Values that are not specified in this update command will not be available in the document anymore.
Only the '_id' field must not be specified since it's an internal field maintained by Mongo DB.
So far all Mongo DB update queries only updated/replaced exactly one document even though the selector matched multiple documents.
To update all matching documents an addional option must be set: db.customers.update( , , ); This command returns the following result: Write Result() In this example n Matched shows that two documents have been found by the document selector query but n Modified shows that only one document have been updated by the update command.
When the zip code is 94101 it will be 94102 after the update.