There is a bug with using collection.update with upsert:true. collection.update should always be return the number of matched documents. When redis-oplog is in use, using collection.update with options.upsert set tot true returns an object with numberAffected and insertedId (this is an output similar to when using collection.upsert).
There is a bug with using collection.update with upsert:true. collection.update should always be return the number of matched documents. When redis-oplog is in use, using collection.update with options.upsert set tot true returns an object with numberAffected and insertedId (this is an output similar to when using collection.upsert).
I did some digging and it looks like when upsert is true for an update, it will call Mutator._handleUpsert, this explains why it returns like an upsert. A possible fix is to attach _returnObject: false to the config that is passed into _handleUpsert and switch around how the config fields are merged together for the Originals.update.call in _handleUpsert.
Here are some basic assertions that can be used to verify the fix: