get document sorted from newest to oldest

Anything concerning integration via the REST API
Post Reply
justkoss
Posts: 3
Joined: Tue Aug 10, 2021 12:00 pm

get document sorted from newest to oldest

Post by justkoss »

i'm working with mayan through the API and I'm trying to sort them by creating date,
for my http request I used :

_ordering : datetime_created

but it seems to get me the oldest document at first the the reverse, is there a way to sort from newest to oldest .
User avatar
rosarior
Developer
Developer
Posts: 688
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: get document sorted from newest to oldest

Post by rosarior »

Use:

Code: Select all

 _ordering : -datetime_created
to reverse the ordering.

The 'Filter' button will show all fields available for sorting for each object.
2021-12-21_05-22.png
2021-12-21_05-22.png (138.58 KiB) Viewed 470 times
justkoss
Posts: 3
Joined: Tue Aug 10, 2021 12:00 pm

Re: get document sorted from newest to oldest

Post by justkoss »

thank you so much for the help
Post Reply