$sort is a great mongo’s modifier!
The $sort modifier orders the elements of an array during a $push operation.
According to the documentation, setting $slice
is not one of its requirements. Minimongo, however, requires $slice
to be set as a zero or negative number.
I checked Meteor’s code trying to understand why, but I cannot find the reasons. Could someone help me on that?
I could workaround it by setting $slice
as the opposite of
(destination list).length + (items being added).length
but I would risk losing data in case of a race condition.