Suppose the model is structured as
{
events: [
{
date: '2016-06-01',
name: 'Children Day'
},
{
date: '2016-01-01',
name: 'New Year Day'
},
{
date: '2016-12-25',
name: 'Christmass'
}
]
}
There could be a lot of events in our storage. From client side, we want to issue a query to get 10 events order by date in ascending order.
How to present this kind of query in Falcor?
Heres what I would do: first, promote your events to entities, i.e. give them ids:
Then provide a route providing these events by id:
which returns the original data. Now you can create a new route for orderings
which returns references into the
eventsByIdroute. This way your client could even request the same data sorted in different ways within the same request!which would return