Skip to content

Commit

Permalink
Added OperatorType.IN for use with DynamoDB filter expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed May 25, 2023
1 parent 8488b84 commit c28604d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .releases/4.25.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**New Features**

* Added `OperatorType.IN` for use with DynamoDB filter expressions.
12 changes: 12 additions & 0 deletions aws/dynamo/query/definitions/OperatorType.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ module.exports = (() => {
return operatorTypeBeginsWith;
}

/**
* Attribute matches one of the operand values.
*
* @public
* @returns {OperatorType}
*/
static get IN() {
return operatorTypeIn;
}

/**
* Attribute exists.
*
Expand Down Expand Up @@ -224,5 +234,7 @@ module.exports = (() => {
const operatorTypeAttributeExists = new OperatorType('Attribute Exists', (f, o) => `attribute_exists(${f})`, 0, [ ]);
const operatorTypeAttributeNotExists = new OperatorType('Attribute Not Exists', (f, o) => `attribute_not_exists(${f})`, 0, [ KeyType.HASH, KeyType.RANGE ]);

const operatorTypeIn = new OperatorType('In', (f, o) => `${f} IN (${o.join(',')})`, 2, [ KeyType.RANGE ]);

return OperatorType;
})();

0 comments on commit c28604d

Please sign in to comment.