0
사용, 나는 성공적 https://github.com/serverless/examples/blob/master/aws-node-rest-api-with-dynamodb/todos/update.js#L22-L37업데이트 몇 가지 속성 만 DynamoDB의에서 코드 아래
const params = {
TableName: process.env.DYNAMODB_TABLE,
Key: {
id: event.pathParameters.id,
},
ExpressionAttributeNames: {
'#todo_text': 'text',
},
ExpressionAttributeValues: {
':text': data.text,
':checked': data.checked,
':updatedAt': timestamp,
},
UpdateExpression: 'SET #todo_text = :text, checked = :checked, updatedAt = :updatedAt',
ReturnValues: 'ALL_NEW',
};
가 그럼 난 더 속성을 추가 항목
를 업데이트 모든 속성. 난 단지 내가 이메일과 비밀번호를 매번 업데이트 할 필요가 있기 때문에, 그 중 일부를 업데이트 할 경우
$ cat test/user-1.json
{
"name": "Bob",
"email": "[email protected]",
"username": "bob",
"password": "adfdsfdsf",
"checked": false
}
는하지만, 나는 코드를 변경하는 방법 오류 Couldn't fetch the user item.
그래서
$ cat test/user-1.json
{
"name": "Bob",
"username": "bob-1",
"checked": false
}
$ curl -X PUT ${url}/${id} --data '@test/user-1.json'
Couldn't fetch the user item.
있어 그 I 돈 모든 속성을 업데이트해야합니다.