[SERVER-32250] v3.6 $setOnInsert may create objects with dots in field names Created: 10/Dec/17 Updated: 10/Dec/17 Resolved: 10/Dec/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 3.6.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Roman Kuzmin | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
v3.6 $setOnInsert may create objects with dots in field names v3.4 used to fail in this case because dots are not allowed in field names. The following command adds a document which sub-document has a field "bad.1" {{> db.test.update({y : {y : {"bad.1" : 1}} }, {$setOnInsert : {x : 42}}, {upsert : true}) ) > db.test.find() }, "x" : 42 } |
| Comments |
| Comment by Tess Avitabile (Inactive) [ 10/Dec/17 ] |
|
Hello nightroman, Thank you for checking about this. This behavior is in fact intentional. Please see the discussion on Best, |
| Comment by Roman Kuzmin [ 10/Dec/17 ] |
|
Another example is with $addToSet. It failed in 3.4 and works in 3.6. db.test.save( { _id: 1, letters: ["a", "b"] }) db.test.update( , } } |