Reputation: 1660
I have a list named "A" which stores a list of objects. Each object will be something like this,
"A" : [
{
"B" : "aaaaa",
"C" : "sssss"
},
{
"B" : "asasa",
"C" : "sasas"
}
]
How would I query and filter these objects held by A? I have tried the following KeyCondition Expressions,
" A[*].B = 'aaaaaa' "
" A.B = 'aaaaaa' "
But none of it does what I like to do.
EDIT 1:
Using "aws-java-sdk-dynamodb" v1.11.31
Query Spec is built as below,
QuerySpec query = new QuerySpec().withHashKey("user_name", "disney")
.withFilterExpression("A[*].B = :value")
.withValueMap(new ValueMap()
.withString(":value","aaaaa"));
ItemCollection<QueryOutcome> = table.query(query);
Upvotes: 3
Views: 788
Reputation: 1660
I guess, there is no way to accomplish what I was trying to do. I ended up writing loop which generated the filter expressions I needed and I was querying multiple times to accomplish this.
Upvotes: 1