7

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.

1 Answer 1

16

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" }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.