As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
What's the best practice for fetching entries grouped by date?
W
William Bergin
started a topic
about 10 years ago
I have a collection of notices and I'd like them grouped by date. I could do this on the client side by creating the object structure I need from a query, or I could use collection access to return a JSON object in the structure that I want. The collection access seems like the smarter solution; I'm just not sure how to go about implementing it.
Here is roughly the structure I'd like:
[{"posted_on" : "some date",
"entries" :[{ "title" : "A Title"},{"title" : "A Title"}]
},
{"posted_on" : "some date",
"entries" :[{ "title" : "A Title"},{"title" : "A Title"}]
What's your data model look like currently? What library are you using to develop your app in? We have some grouping functions that would potentially return what you are looking for within the libraries themselves.
O
OhmzTech
said
almost 10 years ago
Assuming we don't use the Kinvey entity dates, I'm guessing there isn't any automatic way to handle date filtering/grouping with queries - as the date would really just be stored as a string in whatever format you submit. If that's true, maybe a Kinvey dev can confirm if our best solution be to implement a collection hook or maybe use the matches operator with a regex set up for our specific date format?
William Bergin
Here is roughly the structure I'd like:
[{"posted_on" : "some date",
"entries" :[{ "title" : "A Title"},{"title" : "A Title"}]
},
{"posted_on" : "some date",
"entries" :[{ "title" : "A Title"},{"title" : "A Title"}]
}]
Any help would be appreciated.
— Bill