Considering that the dynamodb item/record may not exist, and this needs to be an upsert operation only on the intended path, I’m trying to do this with an UpdateCommand
.
Here’s my UpdateExpression
:
SET #attachments = if_not_exists(#attachments, :emptyRecord),
#attachments.#attachmentId = :attachmentRecord
I get this error:
ValidationException: Invalid UpdateExpression: Two document paths overlap with each other; must remove or rewrite one of these paths; path one: [attachments], path two: [attachments, attachmentId]
I’m only interested in having this work in a single mutation, not including transactions.