How can I get data in ascending using DynamoDB

28 views Asked by At

I'm Using the DynamoDB Database has around 2,40,000 data how to get the latest added data first in scanCommand

1

There are 1 answers

0
Leeroy Hannigan On

That you cannot do. DynamoDB stores data in sorted order based on the sort key as it relates to the partition key, but there is no order for partition keys.

If you need a global sorted order, like it seems then you need to use an index. Have a read of this blog post that describes how:

Effective data sorting with Amazon DynamoDB | AWS Database Blog