3
我正在嘗試更新email
(HASH PK),id
和verifyToken
。我的查詢是這樣的:如何通過主鍵和其他條件更新項目?
params =
TableName: 'users'
Key:
email:
S: '[email protected]'
AttributeUpdates:
verified:
Action: 'PUT'
Value:
BOOL: true
verifyToken:
Action: 'DELETE'
ExpressionAttributeValues:
':id': { S: '123' }
':verifyToken': { S: 'XXX' }
ConditionExpression: 'id = :id and verifyToken = :verifyToken'
dynamodb.updateItem(params)
換句話說,我要更新項目,其中電子郵件=「[email protected]」和id =「123」 AND verifyToken =「XXX」,但我得到以下錯誤:
Can not use both expression and non-expression parameters in the same request:
Non-expression parameters: {AttributeUpdates}
Expression parameters: {ConditionExpression}