[SERVER-3219] $inc can sometimes rename existing fields when they end in '0' Created: 08/Jun/11 Updated: 09/Jun/11 Resolved: 09/Jun/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bernie Hackett | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Steps to reproduce: > db.test.foo.insert({"a": {"c0":1}, 'c':2}) ) , "c" : 2 } , {'$inc':{'a.b0':1}}) ) , "c" : 2 } //Things go off the rails. This should add a new field, 'c00' , {'$inc':{'a.c00':1}}) ) // Notice the 'c0' key has been changed to 'c00'. This should have added a new field. , "c" : 2 } // This works as expected. , {'$inc':{'a.cc':1}}) ) , "c" : 2 } |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 09/Jun/11 ] |
|
See |
| Comment by gsk [ 09/Jun/11 ] |
|
> db.foo.remove() > db.foo.insert( {"a1":1, "c":1}) > db.foo.update( {"c":1}, {$set:{"a00001":1}}) > db.foo.update( {"c":1}, {$set:{"a0000000001":1}}) > db.foo.update( {"c":1}, {$set:{"a00000000011":1}}) so i guess the character of '0' be ignored by mongodb |