When I attempt to update DynamoDB using the code below I get
ValidationException: ExpressionAttributeValues contains invalid key: Syntax error; key: "approved"
I can't see why it is invalid
type TransactionUpdate struct {
Approved bool `json:"approved"`
Signer int `json:"signer"`
}
var TXkey Transaction
TXkey.TxID = sr.TxID
key, err := dynamodbattribute.MarshalMap(TXkey)
updateData, err := dynamodbattribute.MarshalMap(TransactionUpdate{
Approved: true,
Signer: 1,
})
updateString := "set approved=:a add signers :s"
input := &dynamodb.UpdateItemInput{
Key: key,
TableName: aws.String("Transactions"),
UpdateExpression: aws.String(updateString),
ExpressionAttributeValues: updateData,
ReturnValues: aws.String("ALL_NEW"),
}
result, err := svc.UpdateItem(input)
dynamodbattribute.UnmarshalMap(result.Attributes, &tx)
Any help much appreciated