UNPKG

json-sql-enhanced

Version:

Node.js library for mapping MongoDB-style query objects to SQL queries with enhanced operators and multi-dialect support

16 lines (12 loc) 398 B
'use strict'; module.exports = function (dialect) { dialect.modifiers.add('$jsonConcatenate', (field, value) => [field, '=', field, '||', value].join(' '), ); dialect.modifiers.add('$jsonDelete', (field, value) => [field, '=', field, '-', value].join(' '), ); dialect.modifiers.add('$jsonDeleteByPath', (field, value) => [field, '=', field, '#-', value].join(' '), ); };