I\'m trying to query a DynamoDB table to find all items where the email attribute is not set. A global secondary index called EmailPasswordIndex ex
@jaredHatfield is correct if the field does not exist but that will not work if the filed is null. NULL is a keyword and can't used directly. But you can use it with ExpressionAttributeValues.
const params = {
TableName: "Accounts",
FilterExpression: "attribute_not_exists(email) or email = :null",
ExpressionAttributeValues: {
':null': null
}
}
dynamodb.scan(params, (err, data) => {
if (err)
console.log(JSON.stringify(err, null, 2));
else
console.log(JSON.stringify(data, null, 2));
})