File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ const buildConditionExpressions = (
3838 expression += `${ expressionName } ${ operator } :val${ i } _1 AND :val${ i } _2` ;
3939 attrValues [ `:val${ i } _1` ] = value [ 0 ] ;
4040 attrValues [ `:val${ i } _2` ] = value [ 1 ] ;
41+ } else if ( operator === 'ATTRIBUTE_EXISTS' || operator === 'ATTRIBUTE_NOT_EXISTS' ) {
42+ expression += `${ operator . toLowerCase ( ) } (${ expressionName } )` ;
4143 } else {
4244 expression += `${ expressionName } ${ operator } :val${ i } ` ;
4345 attrValues [ `:val${ i } ` ] = value ;
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ export function keyOperatorLookup(
3939 return 'BEGINS_WITH' ;
4040 case 'exists' :
4141 return 'EXISTS' ;
42+ case 'attribute_exists' :
43+ return 'ATTRIBUTE_EXISTS' ;
44+ case 'attribute_not_exists' :
45+ return 'ATTRIBUTE_NOT_EXISTS' ;
4246 default :
4347 return '=' ;
4448 }
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ export type DynamoDBOperators =
2525 | 'BEGINS_WITH'
2626 | 'IN'
2727 | 'EXISTS'
28- | 'CONTAINS' ;
28+ | 'CONTAINS'
29+ | 'ATTRIBUTE_EXISTS'
30+ | 'ATTRIBUTE_NOT_EXISTS' ;
2931
3032/**
3133 * Operators for where clauses
@@ -41,6 +43,8 @@ export type FilterOperators =
4143 | 'between'
4244 | 'like'
4345 | 'exists'
46+ | 'attribute_exists'
47+ | 'attribute_not_exists'
4448 | 'beginsWith' ;
4549/**
4650 * Matching predicate comparison
You can’t perform that action at this time.
0 commit comments