Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

json - 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

question from:https://stackoverflow.com/questions/65904211/max-parameter-is-not-working-in-restdb-io

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...