Reputation: 857
I am trying to query dynamodb using the low-level client api of boto3.
response = client.query(
TableName='People',
IndexName='country-index',
KeyConditionExpression='country = :country',
FilterExpression="attribute_not_exists('age') AND attribute_not_exists('address')",
ExpressionAttributeValues={
":country":{"S": "USA"}
},
Limit=100
)
I get a syntax error :
An error occurred (ValidationException) when calling the Query operation: Invalid FilterExpression: Syntax error; token: "'", near: "('age"
The documentation in boto3 redirects to Amazon developer guide. I was not able to find the syntax for client.query(...). The examples listed there are for using table.query(...)
Upvotes: 1
Views: 10228
Reputation: 39226
Please change the FilterExpression
as mentioned below.
FilterExpression="attribute_not_exists(age) AND attribute_not_exists(address)",
Upvotes: 6