Help me, Obi-Wan...
I'm trying to do a docClient.transactWrite(params)
, where my params
look like (there are other fields too, trying to keep this fairly short):
{
"TransactItems": [
{
"Put": {
"Item": {
"slug": {
"S": "marbled_crockpot_cheesecake"
},
"tag": {
"S": "metadata"
},
"recipe_name": {
"S": "Marbled Crockpot Cheesecake"
}
},
"TableName": "recipes-table-dev"
}
},
{
"Put": {
"Item": {
"slug": {
"S": "marbled_crockpot_cheesecake"
},
"tag": {
"S": "marbled"
},
"recipe_name": {
"S": "Marbled Crockpot Cheesecake"
}
},
"TableName": "recipes-table-dev"
}
}
]
}
As near as I can tell by looking at this example and the official documentation it's fine, but whenever I run it I get to following error:
ERROR Error performing transactWrite { cancellationReasons:
[ { Code: 'ValidationError',
Message:
'One or more parameter values were invalid: Type mismatch for key slug
expected: S actual: M' } ],
I should point out that the Primary partition key is slug (String)
and the Primary sort key tag (String)
. So I don't understand the Type mismatch for key slug expected: S actual: M
phrase: If it's expecting S
, well, that's what I sent, right? I don't see an M
in there anywhere.