|
When update does a simple $push we write a $set to single array element to the oplog.
Same when there is a $slice with it that's a "no-op"
However, when there is a $sort that's a no-op we do not detect that.
// updates
|
db.test.update({},{$push:{a:{$each:[11]}}})
|
db.test.update({},{$push:{a:{$each:[12],$slice:100}}})
|
db.test.update({},{$push:{a:{$each:[13],$slice:100,$sort:1}}})
|
// oplog entries (just the "o" field
|
{ "o" : { "$v" : 1, "$set" : { "a.6" : 11 } } }
|
{ "o" : { "$v" : 1, "$set" : { "a.7" : 12 } } }
|
{ "o" : { "$v" : 1, "$set" : { "a" : [ 0, 1, 2, 4, 5, 10, 11, 12, 13 ] } } }
|
|