I’m trying to insert a nested map into my dynamo DB row but can’t wrap my head around how to do it using js.
Here's the object I was trying to update into the DDB
"person":{
"M":{
"name":{
"M":{
"david":{
"M":{
"cars":{
"SS":[
"suv",
"jeep"
]
}
}
}
}
}
}
}
Here are my objects
interface david{
cars[]
}
var name = "name";
Here's What I tried
UpdateExpression: 'SET person.#name = :david'
ExpressionAttributeNames:{
"#name": name,
"#pname": "david",
"#cars": "cars"
}
ExpressionAttributeValues:{
":cars" : {SS:["suv","jeep"]},
":david" : {//TODO: how do i substitute the value of cars here}
I'm not really sure how to build the update expression to update the nested maps