json-sql-enhanced
Version:
Node.js library for mapping MongoDB-style query objects to SQL queries with enhanced operators and multi-dialect support
18 lines (14 loc) • 457 B
JavaScript
;
module.exports = function (dialect) {
dialect.operators.state.add('$not', {
getOperator(operator) {
const operatorParameters = dialect.operators.comparison.get(operator);
if (!operatorParameters || !operatorParameters.inversedOperator) {
throw new Error(
'Cannot get inversed operator for operator `' + operator + '`',
);
}
return operatorParameters.inversedOperator;
},
});
};