baopham / laravel-dynamodb

Eloquent syntax for DynamoDB
https://packagist.org/packages/baopham/dynamodb
MIT License
490 stars 127 forks source link

How to use 'Sort descending' #265

Closed SoftrainHere closed 1 year ago

SoftrainHere commented 1 year ago

My model looks like this

protected $dynamoDbIndexKeys = [
  'event_from-created_at-index' => [
    'hash' => 'event_from',
    'range' => 'created_at'
  ],
];

and I am using sort query like this

Log::query()
  ->withIndex('event_from-created_at-index') 
  ->decorate(function (RawDynamoDbQuery $raw) { 
  $raw->query['ScanIndexForward'] = false; 
}) 
->get(); 

and it shows me like below

created_at: 2022-12-07 08:50:16
created_at: 2022-12-08 08:50:16 created_at: 2022-12-09 08:50:16

actually It works on aws console 제목 없음

I set my partition / sort key like below 제목 없음2

this is my Global secondary indexes 제목 없음1

Can you help me what i should do for this?

akshay-shopcircle commented 3 months ago

@SoftrainHere If you have fixed this, can you share here as I'm also facing the same.