I have a table and the structure is as follows:

When I make a request, I would like to be able to do a filter of requests on the data map; but I'm not quite sure how to configure the request.
This is what I have so far:
HashMap<String, AttributeValue> map = new HashMap<String, AttributeValue>(); map.put("byUserId", new AttributeValue().withS("vl49uga5ljjcoln65rcaspmg8u")); queryExpression .withQueryFilterEntry("data", new Condition() .withAttributeValueList(new AttributeValue().withM(map)) .withComparisonOperator(ComparisonOperator.CONTAINS));
but the way I create the filter is incorrect, and I continue to work with the following error:
Exception in thread "main" com.amazonaws.AmazonServiceException: One or more parameter values were invalid: ComparisonOperator CONTAINS is not valid for M AttributeValue type (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: CHIOME68L1HVGO81URD7CIOS6BVV4KQNSO5AEMVJF66Q9ASUAAJG) at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1077) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:725) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:460) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:295) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:3106) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.query(AmazonDynamoDBClient.java:1118)
So, what is the comparison operator that I have to use (since IN is for list types) and how can I create a query filter so that I can specify the comparison inside the MAP.
Thanks!
source share