AWS DynamoDB scan FilterExpression uses unequal rows in a list

I have a list with an identifier of type String. I want to scan DynamoDB and get a list of results with elements that DO NOT have these identifiers. But I can’t figure out how to type a filter expression. ReviewId is the primary key of a section of type String.

Map<String, AttributeValue> eav = new HashMap<>();
eav.put(":idFilter", new AttributeValue().withSS(idFilter));

DynamoDBScanExpression scanExp = new DynamoDBScanExpression()
          .withFilterExpression("ReviewId <> (:idFilter)")
          .withExpressionAttributeValues(eav);

The above filter expression is valid, but it still always returns elements with an identifier in the list. I also tried to include the word inbefore and after the statement <>.

+4
source share
1 answer

, , ExpressionAttributeValues :reviewId1, :reviewId2, :reviewId3.

FilterExpression: "NOT ReviewId in (:reviewId1, :reviewId2, :reviewId3)"

: -

, idFilter SET LIST DynamoDB.

+5

Source: https://habr.com/ru/post/1672148/


All Articles