diff --git a/dist/js-data-sql.js b/dist/js-data-sql.js index c00c8aa..a96f5f5 100644 --- a/dist/js-data-sql.js +++ b/dist/js-data-sql.js @@ -426,7 +426,13 @@ module.exports = // Perform `WHERE EXISTS` subquery for hasMany property var existsParams = _defineProperty({}, parts[0], criteria); var subQuery = _this7.filterQuery(relationResourceConfig, existsParams, options).whereRaw('??.??=??.??', [getTable(relationResourceConfig), relation.foreignKey, getTable(localResourceConfig), localResourceConfig.idAttribute]); - query.whereExists(subQuery); + if (Object.keys(criteria).some(function (k) { + return k.indexOf('|') > -1; + })) { + query.orWhereExists(subQuery); + } else { + query.whereExists(subQuery); + } criteria = null; // criteria handled by EXISTS subquery } diff --git a/package.json b/package.json index e2a58cd..7955a85 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-data-sql", "description": "Postgres/MySQL/MariaDB/SQLite3 adapter for js-data.", - "version": "0.11.13", + "version": "0.11.14", "homepage": "http://www.js-data.io/docs/dssqladapter", "repository": { "type": "git",