I am trying to fetch items, which satisfies certain conditions, from dynamodb
Here is the Item JSON structure.
{
"userID": "3201054407a58",
"createdDate": 1643769000000,
"modifiedDate": 1643769000000,
"attributes": {
"zipCode": "683562",
"country": "India",
"deleteFlag": "1"
}
}
Partition key: userID Sort key: createdDate
I would like to filter results based on deleteFlag. ie; if deleteFlag not equal to 1, it should appear on result set.
The query I am using is as given below.
let params = {
"TableName": 'user',
KeyConditionExpression: "#uid = :id AND createdDate BETWEEN :minDate AND :maxDate",
FilterExpression: '#deleteFlag <> :deleteFlag'
ExpressionAttributeValues: {
':id': uuid,
':minDate': from,
':maxDate': to,
':deleteFlag': "1"
},
ExpressionAttributeNames: {
'#uid': 'userID',
'#deleteFlag': 'attributes.deleteFlag'
}
};
But, above filter is not working.
How to filter based on deleteFlag
.
Please help on this.