Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
http://docs.mongodb.org/manual/reference/method/db.collection.update/
Most people from an SQL background expect only the stated fields to be updated e.g.
db.foo.update({_id: ObjectId(...)}, {a:1, b:1})
|
would only modify fields a and b and leave the rest untouched.
Suggest rewording the introduction to
Modifies an existing document or documents in a collection. Can be used to either modify only specific fields, or to replace the document or documents entirely, depending on the update parameters passed.
I think we need the hint at two use-cases right at the start as it is a very common mistake to accidentally wipe out an entire document doing an update incorrectly.
(Users still may not read it and get into strife, but at least we tried)