-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
None
-
Affects Version/s: 1.6.0
-
Component/s: Usability
-
None
-
Environment:all
-
Query
-
Major Change
How about changing update() to be consistent with find().
Make update() by default affect all records matched, unless a limit() is supplied
This allows the removal of update's currently optional "multi" argument.
Furthermore, an updateOne() helper could be added, similar to findOne(). (Though not necessary, API symmetry can be nice.)
Many new people get tripped up by missing the multi flag on update()--it's not the expected behavior. A self-consistent API is a usability win.
Any code that specifies a unique _id for the criteria will not be affected. Most code that doesn't probably wants to affect all matching records anyways.
- is related to
-
SERVER-1690 justOne flag for updates
- Closed