I have a DynamoDB table with a model that contains and itemData
property of type Map
that contains count
and limit
properties.
"NonKeyAttributes": [
{
"AttributeName": "creationDate",
"AttributeType": "N"
},
{
"AttributeName": "modificationDate",
"AttributeType": "N"
},
{
"AttributeName": "itemData",
"AttributeType": "M"
}
],
I am trying to write a condition check that looks like this:
UpdateExpression: 'set itemData.count = itemData.count + :val',
ConditionExpression: 'itemData.count < itemData.limit',
ExpressionAttributeValues: {
':val': 1
}
My problem is that the conditional check fails, regardless the values of count
and limit
, here are the current values pulled from row.
"limit": {
"N": "1"
},
"count": {
"N": "0"
},
Is this even allowed? I have been pulling my hair out on this for a while now.
I have also run the condition against my root level creationTime
/modificationTime
properties, and that conditional check works fine. I am really hoping I can do the condition on the property within the map.