|
You can no longer create that empty field. Even if I use black-magic to get a doc in there with an empty field name it still works:
> db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test..two': 1}}, new:true})
|
2013-11-20T14:02:51.557-0500 findAndModifyFailed failed: {
|
"errmsg" : "exception: The update path 'counters.test..two' contains an empty field, which is not allowed.",
|
"code" : 16840,...
|
|
> db.test.remove()
|
... do magic...
|
> db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test.two': 1}}, new:true})
|
{
|
"_id" : 1,
|
"name" : "TEST",
|
"counters" : {
|
"test" : {
|
"one" : 1,
|
"" : {
|
"two" : 0
|
},
|
"two" : 1
|
}
|
}
|
}
|
test1:PRIMARY> db.test.findAndModify({query:{'name': 'TEST'}, update:{'$inc': {'counters.test.two': 1}}, new:true})
|
{
|
"_id" : 1,
|
"name" : "TEST",
|
"counters" : {
|
"test" : {
|
"one" : 1,
|
"" : {
|
"two" : 0
|
},
|
"two" : 2
|
}
|
}
|
}
|
|