---
lang: en
title: 'API docs: sequelize.sequelizecrudrepository.buildsequelizeorder'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/sequelize
permalink: /doc/en/lb4/apidocs.sequelize.sequelizecrudrepository.buildsequelizeorder.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/sequelize](./sequelize.md) &gt; [SequelizeCrudRepository](./sequelize.sequelizecrudrepository.md) &gt; [buildSequelizeOrder](./sequelize.sequelizecrudrepository.buildsequelizeorder.md)

## 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:**

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  order | string\[\] \| string | _(Optional)_ Sorting order in loopback style filter. eg. <code>title ASC</code>, <code>[&quot;id DESC&quot;, &quot;age ASC&quot;]</code> |

**Returns:**

Order \| undefined

Sequelize compatible order filter value


