[SERVER-4509] $each must check its parms Created: 16/Dec/11 Updated: 11/Jul/16 Resolved: 16/Jul/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Dwight Merriman | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | pull-request | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
it's easy to pass an object instead of an array by mistake. returning an error would be ok but adding something containing "$each" as a field is bad. same check needs to happen if the value is other types. > t.update({},{ $addToSet : { a : { $each : { "0":3 } } } }) } ] } |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 16/Jul/13 ] | |||||
|
This is now fixed with the new update refactoring. We can add this to the test once we enable it as the default code path.
| |||||
| Comment by Scott Hernandez (Inactive) [ 23/Apr/13 ] | |||||
|
This also happens when using a scalar like 3. Should we treat the single value as an array of 1 item?
| |||||
| Comment by Shannon Weyrick [ 08/Jun/12 ] | |||||
|
Pull request up for comments here: |