-1

I am new to dynamodb.

I want to increment the Sort Key

If the id=0 the next id=1 and so on,

If the user(Partition key), id(Sort Key) add items the next add items the id increment 1.

The code use on PutItem with dynamodb.

Is possible to do that?

I did not want use the UUID( unique Key)

Zoe stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
M H
  • 1
  • 1

1 Answers1

1

Most situations don't need an auto-incrementing attribute and DynamoDB doesn't provide this feature out of the box. This is considered to be an anti-pattern in distributed systems.

But, see How to autoincrement in DynamoDB if you really need to.

jarmod
  • 59,580
  • 13
  • 95
  • 104