|
Are you sure you are using 2.6.0? Please run "db.version()" to verify that the server is 2.6.0.
I cannot reproduce this with 2.6.0 locally:
> db.version()
|
2.6.0
|
> db.a.save({ subdoc: { array: ['0', '1', '2', '5', '6'] } ,_id:1})
|
WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : 1 })
|
> db.a.find()
|
{ "_id" : 1, "subdoc" : { "array" : [ "0", "1", "2", "5", "6" ] } }
|
> db.a.update({}, {$push:{"subdoc.array": {$each:['3','4'], $position:2}}})
|
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
|
> db.a.find()
|
{ "_id" : 1, "subdoc" : { "array" : [ "0", "1", "3", "4", "2", "5", "6" ] } }
|
|