I want to add an int to a list in DynamoDB. This works:
update := expression.Set(
expression.Name("signers"),
expression.Name("signers").ListAppend(expression.Value([]int{theInt})),
)
expr, err := expression.NewBuilder().WithUpdate(update).Build()
But only if there is a value already in the list. I want to create the list if it doesn't exist. I tried:
.Add(
expression.Name("signers"),
expression.Value(theInt),
and
.Add(
expression.Name("signers"),
expression.Value([]int{theInt}),
Which both return:
ValidationException: Invalid UpdateExpression: Incorrect operand type for operator or function; operator: ADD, operand type:LIST
How do I set the type of theInt to a list?
I must be missing something obvious