Reputation: 2611
I'm doing a table scan. This table has an array as one of its fields, the "apps" field (apps is not a key of any kind). I want to select all rows, whose apps array contains a certain value "MyApp". I tried something of that kind, but my syntax is incorrect:
ComparisonOperator = "#apps CONTAINS :v",
ExpressionAttributeNames = {
'#apps': 'apps'
},
ExpressionAttributeValues = {
":v": "MyApp"
}
Thanks.
Upvotes: 7
Views: 14457
Reputation: 26331
The documentation about Condition Expressions clearly states that the appropiate syntax is:
contains(#apps, :v)
The correct request would be:
FilterExpression: "contains(#apps, :v)",
ExpressionAttributeNames: { "#apps": "apps" },
ExpressionAttributeValues: { ":v": "MyApp" }
Upvotes: 16