Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
2.4.3
-
None
-
OSX, Ubuntu
-
ALL
-
Description
I'm watching the oplog for use within my application. I'm noticing some difference in behavior between 2.2.0 and 2.4.3. This is the query that's being run:
chats.update(
{ _id: ObjectId("51a0249adae44c01b0000003") }) { '$pushAll': { messages: [
{ _id: ObjectId("51a3dc72aead18550a000003"), timestamp: new Date("Mon, 27 May 2013 22:21:38 GMT"), username: 'Bob', message: 'hey' }] } } {}
It is generated by Mongoose as the result of pushing to a subdocument and calling model.save().
In Mongo 2.2.0 this produces the following oplog entry:
https://gist.github.com/bitmage/5659191
While in Mongo 2.4.3 it produces this:
https://gist.github.com/bitmage/5659209
So it seems the 'pushAll' is being transformed into a 'set' which pushes out the contents of the entire Array.
Can someone familiar with this change comment on the reason for it and if this will be changing back? Definitely doesn't seem good for my case... this would force my application to figure out the delta, and it also results in a lot of unnecessary data being sent around.