(key, value, options)
| 2459 | } |
| 2460 | |
| 2461 | _whereJSON(key, value, options) { |
| 2462 | const items = []; |
| 2463 | let baseKey = this.quoteIdentifier(key); |
| 2464 | if (options.prefix) { |
| 2465 | if (options.prefix instanceof Utils.Literal) { |
| 2466 | baseKey = `${this.handleSequelizeMethod(options.prefix)}.${baseKey}`; |
| 2467 | } else { |
| 2468 | baseKey = `${this.quoteTable(options.prefix)}.${baseKey}`; |
| 2469 | } |
| 2470 | } |
| 2471 | |
| 2472 | Utils.getOperators(value).forEach(op => { |
| 2473 | const where = { |
| 2474 | [op]: value[op] |
| 2475 | }; |
| 2476 | items.push(this.whereItemQuery(key, where, { ...options, json: false })); |
| 2477 | }); |
| 2478 | |
| 2479 | _.forOwn(value, (item, prop) => { |
| 2480 | this._traverseJSON(items, baseKey, prop, item, [prop]); |
| 2481 | }); |
| 2482 | |
| 2483 | const result = items.join(this.OperatorMap[Op.and]); |
| 2484 | return items.length > 1 ? `(${result})` : result; |
| 2485 | } |
| 2486 | |
| 2487 | _traverseJSON(items, baseKey, prop, item, path) { |
| 2488 | let cast; |
no test coverage detected