I need to check list of data with contains
function is DynamoDB. Following is my Java Code,
List<String> dataList = new ArrayList<>();
I am inserting the above list inside a JSON called Data.
Map<String, AttributeValue> valueMap = new HashMap<>();
valueMap.put(":v", new AttributeValue().withS(String.valueOf(dataList)));
Map<String, String> nameMap = new HashMap<>();
nameMap.put("#list", "Data.list");
DynamoDBQueryExpression<> queryExpression = new DynamoDBQueryExpression<>()
.withFilterExpression("contains(#list, :v)")
.withExpressionAttributeNames(nameMap)
.withExpressionAttributeValues(valueMap)
.withConsistentRead(false);
I used the above approach but it is not working. What I need is I need to filter data if any of the list values contains in the dynamo db inserted list values. The list data is inside Json. So what I am doing wrong here? can anybody help me? Thanks in advance.
question from:
https://stackoverflow.com/questions/65901948/ho-to-use-contains-function-in-dynamodb-with-dynamodbmapper-java 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…