julesfern / spahql

A query language for Javascript data. Extracted from Spah.
MIT License
325 stars 20 forks source link

Add Sorting #21

Open LittleUmbrella opened 11 years ago

LittleUmbrella commented 11 years ago

It would be great to be able to sort by n properties, pretty much like persvr/rql

Another common operator is sort. We can use the sort operator to sort by a specified property. To sort by foo in ascending order:

price=lt=10&sort(+foo)

We can also do multiple property sorts. To sort by price in ascending order and rating i> n descending order:

sort(+price,-rating)