To query for a non-existent (null) attribute in Node DynamoDB, we calkl the scan method.
For instance, we write
const params = {
TableName: "Accounts",
FilterExpression: "attribute_not_exists(email)",
};
dynamodb.scan(params, (err) => {
if (err) console.log(JSON.stringify(err, null, 2));
else console.log(JSON.stringify(data, null, 2));
});
to call scan with the params object to make the query.
We query for null value for the FilterExpression field with 'attribute_not_exists(email)'.