db.user.insert({ x: [] }); db.user.update({ }, { $push: { x: { $each: [1, 2, 3] }}}); db.user.update({ }, { $push: { x: { $each: [4, 5, 6] }}}); db.user.update({ }, { $push: { x: { $each: [7, 8, 9], $slice: -10 }}});
Gives you the result:
{ "_id" : ObjectId("51003755fc4e31f51fe6a84b"), "x" : [ [ 1, 2, 3 ], [ 4, 5, 6 ], 7, 8, 9 ] }
As a user, I was expecting the result to look something like this:
{ "_id" : ObjectId("51003755fc4e31f51fe6a84b"), "x" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] }
- related to
-
CSHARP-684 Add new features to Update builder for server 2.4
- Closed