Я пытаюсь установить значение списка в моей таблице DynamoDB следующим образом:
{
"TableName": "my-table",
"Key": {
"uid": {
"S": "id-value"
}
},
"UpdateExpression": " SET #actions = :actions",
"ExpressionAttributeNames": {
"#actions": "actions"
},
"ExpressionAttributeValues": {
":actions": {
"L": [
"one",
"two"
]
}
},
"ReturnValues": "ALL_NEW"
}
Когда я запускаю это, я получаю следующую ошибку:
{
"message": "There were 8 validation errors:\n* InvalidParameterType: Expected params.ExpressionAttributeValues[':actions'].L[0] to be a structure\n* UnexpectedParameter: Unexpected key '0' found in params.ExpressionAttributeValues[':actions'].L[0]\n* UnexpectedParameter: Unexpected key '1' found in params.ExpressionAttributeValues[':actions'].L[0]\n* UnexpectedParameter: Unexpected key '2' found in params.ExpressionAttributeValues[':actions'].L[0]\n* InvalidParameterType: Expected params.ExpressionAttributeValues[':actions'].L[1] to be a structure\n* UnexpectedParameter: Unexpected key '0' found in params.ExpressionAttributeValues[':actions'].L[1]\n* UnexpectedParameter: Unexpected key '1' found in params.ExpressionAttributeValues[':actions'].L[1]\n* UnexpectedParameter: Unexpected key '2' found in params.ExpressionAttributeValues[':actions'].L[1]",
"code": "MultipleValidationErrors",
"errors": [
{
"message": "Expected params.ExpressionAttributeValues[':actions'].L[0] to be a structure",
"code": "InvalidParameterType",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Unexpected key '0' found in params.ExpressionAttributeValues[':actions'].L[0]",
"code": "UnexpectedParameter",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Unexpected key '1' found in params.ExpressionAttributeValues[':actions'].L[0]",
"code": "UnexpectedParameter",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Unexpected key '2' found in params.ExpressionAttributeValues[':actions'].L[0]",
"code": "UnexpectedParameter",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Expected params.ExpressionAttributeValues[':actions'].L[1] to be a structure",
"code": "InvalidParameterType",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Unexpected key '0' found in params.ExpressionAttributeValues[':actions'].L[1]",
"code": "UnexpectedParameter",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Unexpected key '1' found in params.ExpressionAttributeValues[':actions'].L[1]",
"code": "UnexpectedParameter",
"time": "2018-12-19T15:21:49.307Z"
},
{
"message": "Unexpected key '2' found in params.ExpressionAttributeValues[':actions'].L[1]",
"code": "UnexpectedParameter",
"time": "2018-12-19T15:21:49.307Z"
}
],
"time": "2018-12-19T15:21:49.308Z"
}
Я знаю, чтоодну запись можно добавить с помощью list_append, но мне нужно установить весь список ... Что я делаю не так?
Можно ли задать целую таблицу в одном запросе?
Заранее спасибо