diff --git a/data-queryable.js b/data-queryable.js index f621ac9..af3f3d7 100644 --- a/data-queryable.js +++ b/data-queryable.js @@ -994,7 +994,7 @@ DataQueryable.prototype.join = function(model) }); */ DataQueryable.prototype.and = function(attr) { - Args.check(this.query.$where != null, new Error('The where expression has not been initialized.')); + Args.check(this.query.$where != null || this.query.$prepared!=null , new Error('The where expression has not been initialized.')); if (typeof attr === 'string' && /\//.test(attr)) { this.query.and(DataAttributeResolver.prototype.resolveNestedAttribute.call(this, attr)); return this; @@ -1017,7 +1017,7 @@ DataQueryable.prototype.and = function(attr) { }); */ DataQueryable.prototype.or = function(attr) { - Args.check(this.query.$where != null, new Error('The where expression has not been initialized.')); + Args.check(this.query.$where != null || this.query.$prepared!=null, new Error('The where expression has not been initialized.')); if (typeof attr === 'string' && /\//.test(attr)) { this.query.or(DataAttributeResolver.prototype.resolveNestedAttribute.call(this, attr)); return this; diff --git a/package-lock.json b/package-lock.json index ef9d562..8c736e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@themost/data", - "version": "2.6.56", + "version": "2.6.57", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index c448ef9..bccbe69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@themost/data", - "version": "2.6.56", + "version": "2.6.57", "description": "MOST Web Framework Codename Blueshift - Data module", "main": "index.js", "types": "index.d.ts",