redis-oplog
redis-oplog copied to clipboard
fix: ignore undefined and null params on modifiers
Why?
Sometimes we have a logic like this:
let $set;
if(someCondition) {
$set = {
field: 'value',
};
}
Collection.update(selector, { $set });
The Mongo driver can handle that modifier. It just ignores the $set
operation when its value is null or undefined.
Fixes: #398
Changes
- Ignore operators with null or undefined values
- Added a test case for this scenario
- Added the
isNil
utility function - Added a test case for the
isNil
utility function
Strange that the tests didn't run.
@xolott can you take a look on the tests, now that they have run and failed?