@trenskow/pged 4.0.2 → 4.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/query-builder.js +5 -4
package/package.json
CHANGED
package/query-builder.js
CHANGED
|
@@ -35,7 +35,6 @@ module.exports = exports = class QueryBuilder extends CustomPromise {
|
|
|
35
35
|
this._having = [];
|
|
36
36
|
|
|
37
37
|
this._offset = 0;
|
|
38
|
-
this._limit = Infinity;
|
|
39
38
|
|
|
40
39
|
this._executor = executor;
|
|
41
40
|
|
|
@@ -130,7 +129,7 @@ module.exports = exports = class QueryBuilder extends CustomPromise {
|
|
|
130
129
|
return this;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
limitTo(limit
|
|
132
|
+
limitTo(limit) {
|
|
134
133
|
this._limit = limit;
|
|
135
134
|
return this;
|
|
136
135
|
}
|
|
@@ -280,7 +279,8 @@ module.exports = exports = class QueryBuilder extends CustomPromise {
|
|
|
280
279
|
$gte: '>=',
|
|
281
280
|
$regexp: '~*',
|
|
282
281
|
$jsonContains: '@>',
|
|
283
|
-
$jsonNotContains: '@>'
|
|
282
|
+
$jsonNotContains: '@>',
|
|
283
|
+
$jsonArrayContains: '?'
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
|
|
@@ -321,6 +321,7 @@ module.exports = exports = class QueryBuilder extends CustomPromise {
|
|
|
321
321
|
case '$regexp':
|
|
322
322
|
case '$jsonContains':
|
|
323
323
|
case '$jsonNotContains':
|
|
324
|
+
case '$jsonArrayContains':
|
|
324
325
|
return this._buildConditions(condition[key], operator, key, true);
|
|
325
326
|
default:
|
|
326
327
|
throw new TypeError(`Unknown modifier ${caseit(key)}.`);
|
|
@@ -419,7 +420,7 @@ module.exports = exports = class QueryBuilder extends CustomPromise {
|
|
|
419
420
|
}
|
|
420
421
|
|
|
421
422
|
_buildLimit() {
|
|
422
|
-
if (
|
|
423
|
+
if (typeof this._limit === 'undefined') return;
|
|
423
424
|
return `limit ${this._limit}`;
|
|
424
425
|
}
|
|
425
426
|
|