1 Answers
0
Hey tj! The MAP type need to have each property also mapped to the right type (see this link). If the map has a well defined format, you can map each property at the PutItem.
If the format is unknown, my recommendation is to try the ExecuteStatement with a PartiQL statement as it accepts JSON like maps. Only note that you'll need to do some transformation to convert the double-quotes (") to single-quotes (').
I did the test here:
INSERT INTO "Teste" VALUE {
'id': 'Second',
'info': {
'name': 'John',
'age': '30',
'cars': [
'Ford',
'BMW',
'Fiat'
]
}
}
and at the table I have:
{
"id": {"S": "Second"},
"info": {
"M": {
"age": {"S": "30"},
"cars": {
"L": [
{"S": "Ford"},
{"S": "BMW"},
{"S": "Fiat"}
]
},
"name": {"S": "John"}
}
}
}
answered 15 days ago
Relevant questions
In step function, how do I convert single-object output to array containing single-object.
asked a month agoError, AWS Step Function DynamoDB Put Item, Map and List inside Map
asked 8 months agoDynamoDB in SFN -> Why does it request an ITEM value when it clearly shouldn't
Accepted Answerasked 3 months agoAppSync subscription stopped working after creating the 6th DynamoDB item
asked a year agoStep Function - dynamodb query with Boolean Filter
Accepted Answerasked 6 months agoDynamoDB Item Insert Limit
asked 5 months agoRecommend Users for a specific Item?
asked 9 months agoStep function putItem DynamoDB
asked 6 months agoDMS Support for mapping rules - dynamodb-map data type
asked a month agoDynamoDB in step function is not able to put item with map field
asked 16 days ago
thank you for the reply, can you please post your step function json? I can't figure out how to insert the PartiQL query into ExecuteStatement