Search code examples
jsondatabaseapinosqlrestdb

max parameter is not working in restdb.io


I have a db on restdb.io from which I only want to get data of last 7 days for which I tried using max but it isn't working probably because I'm grouping the data using date field and sorting the data according to the date field so that I would get the data in descending order

Any help would be great, even some work arounds would be okay.

url : https://oidata-5bdd.restdb.io/rest/oidata?groupby=Date&dir=-1&sort=Date


Solution

  • When using aggregation operators max and skip params are ignored. I think a workaround could be to create a custom route with a query and e.g. map/reduce to get the result you want.

    https://restdb.io/docs/custom-rest-routes#restdb