Page Contents

Home > @loopback/sequelize > SequelizeCrudRepository > buildSequelizeOrder

SequelizeCrudRepository.buildSequelizeOrder() method

Get Sequelize Order filter value from loopback style order value.

It also supports passing associations in the order array to sort by nested models. Example: ["user email ASC"].

Signature:

protected buildSequelizeOrder(order?: string[] | string): Order | undefined;

Parameters

Parameter Type Description
order string[] | string (Optional) Sorting order in loopback style filter. eg. title ASC, ["id DESC", "age ASC"]

Returns:

Order | undefined

Sequelize compatible order filter value