I plan on having a Dynamo table with only one entry, something that looks like {"id": "counter", "count": 28734}, where the count acts as an atomic counter. Then use the update-item function to increment the count, regardless of it's value.
I'm struggling to formulate the correct amazonica.aws.dynamodb/update-item function call.
> (dynamo-client/put-item cred
:table-name "atomic-counter"
:item {:id "counter" :count 0})
{:consumed-capacity-units 1.0}
> (dynamo-client/get-item cred
:table-name "atomic-counter"
:key "counter")
{:item {:count "0", :id "counter"}, :consumed-capacity-units 0.5
> (dynamo-client/update-item cred
:table-name "atomic-counter"
:key "counter"
:attributeUpdates {:count "add"})
UnsupportedOperationException nth not supported on this type: Character clojure.lang.RT.nthFrom (RT.java:857)
I've tried a few other variations on the value for attributeUpdates.count.