Sorting documents

To sort the documents (or files) embedded in a collection (or bucket) representation, use the sort_by query parameter.

Default sorting is by _id descending. If _id are ObjectId, this makes sure that last created document or file is the first returned.


sort by the property date ascending

$ http GET

sort by the property date descending

$ http GET

sort by the property date descending and title ascending

http GET

note that you specify multiple sort options using multiple sort_by query parameters

Documentation references

How to use the examples

The examples make use of the brilliant httpie CLI HTTP client and are ment to be used with RESTHeart stareted on the localhost without the authentication enabled.

Eventually pass username and password with the -a username:password option.