test
test

Reputation: 153

Can't query on DynamoDB records where attribute is null

Can't get query on DynamoDB null attributes. I have below query, I am getting NameError: name 'true' is not defined

const filter = {
    FilterExpression: 'id = :null',
    ExpressionAttributeValues: {
        ':null': true,
    },
};

Upvotes: 0

Views: 622

Answers (1)

user3807691
user3807691

Reputation: 1304

You need to specify the type of null as well.

Try this :

const filter = {
  FilterExpression: 'id = :null',
  ExpressionAttributeValues: {
    ':null': {BOOL: true}
  }
};

Upvotes: 1

Related Questions