Skip to content
Branden Horiuchi edited this page Nov 6, 2015 · 2 revisions

Simple and complex ordering can be accomplished by the order method or by an Express request passed to the paginate method. Either way an array of order configurations must be created.


Order configuration

  • OrderConfig Object[] - Array of order configurations
    • field String - field name
    • [direction="asc"] String - The direction to order the field asc or desc

As a query string parameter

?order=<column>[.<direction>][, ...]

Example

Query String

?order=lastname,name.desc

Translates to Order configuration

[
    {
        field: 'lastname'
        direction: 'asc'
    },
    {
        field: 'name'
        direction: 'desc' 
    }
]

Clone this wiki locally