I am using AWS Lambda to get result from Dynamo DB. The returned result from Lambda is this:
Response:
{
"Items": [
{
"name": "unknown",
"rid": "1589816220971",
"rtime": "2020-05-18 23:37:12",
"status": "unsuccessful"
},
{
"name": "acap",
"rid": "1589816876343",
"rtime": "2020-05-18 23:48:10",
"status": "successful"
},
],
"Count": 2,
"ScannedCount": 2
}
But i wanted the returned result inverted as this because i want the recent result first.
Response:
{
"Items": [
{
"name": "acap",
"rid": "1589816876343",
"rtime": "2020-05-18 23:48:10",
"status": "successful"
},
{
"name": "unknown",
"rid": "1589816220971",
"rtime": "2020-05-18 23:37:12",
"status": "unsuccessful"
},
],
"Count": 2,
"ScannedCount": 2
}
Is there any way of doing that or more better way to return the latest item first from DynamoDB using Lambda?