Skip to content

Commit

Permalink
feat(query): adds contains key query operator
Browse files Browse the repository at this point in the history
  • Loading branch information
koriwi committed Sep 17, 2019
1 parent 4348601 commit 75b0b58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/mapping/q.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class QueryAssignment {
* @alias module:mapping~q
* @type {Object}
* @property {function} contains Represents the CQL operator "CONTAINS".
* @property {function} containsKey Represents the CQL operator "CONTAINS KEY".
* @property {function} in_ Represents the CQL operator "IN".
* @property {function} gt Represents the CQL operator greater than ">".
* @property {function} gte Represents the CQL operator greater than or equals to ">=" .
Expand All @@ -80,6 +81,10 @@ const q = {
return new QueryOperator('CONTAINS', value);
},

containsKey: function containsKey(value) {
return new QueryOperator('CONTAINS KEY', value);
},

in_: function in_(arr) {
if (!Array.isArray(arr)) {
throw new errors.ArgumentError('IN operator supports only Array values');
Expand Down

0 comments on commit 75b0b58

Please sign in to comment.