(key, value, options)
| 2636 | } |
| 2637 | |
| 2638 | _whereJSON(key, value, options) { |
| 2639 | const items = []; |
| 2640 | let baseKey = this.quoteIdentifier(key); |
| 2641 | if (options.prefix) { |
| 2642 | if (options.prefix instanceof Utils.Literal) { |
| 2643 | baseKey = `${this.handleSequelizeMethod(options.prefix)}.${baseKey}`; |
| 2644 | } else { |
| 2645 | baseKey = `${this.quoteTable(options.prefix)}.${baseKey}`; |
| 2646 | } |
| 2647 | } |
| 2648 | |
| 2649 | Utils.getOperators(value).forEach(op => { |
| 2650 | const where = { |
| 2651 | [op]: value[op] |
| 2652 | }; |
| 2653 | items.push(this.whereItemQuery(key, where, { ...options, json: false })); |
| 2654 | }); |
| 2655 | |
| 2656 | _.forOwn(value, (item, prop) => { |
| 2657 | this._traverseJSON(items, baseKey, prop, item, [prop]); |
| 2658 | }); |
| 2659 | |
| 2660 | const result = items.join(this.OperatorMap[Op.and]); |
| 2661 | return items.length > 1 ? `(${result})` : result; |
| 2662 | } |
| 2663 | |
| 2664 | _traverseJSON(items, baseKey, prop, item, path) { |
| 2665 | let cast; |
no test coverage detected