Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): allow passing arrays in orderBy parameter #2211

Merged
merged 1 commit into from Sep 18, 2021
Merged

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Sep 18, 2021

FindOptions.orderBy parameter is now strictly typed. It also allows passing an
array of objects instead of just a single object.

const books = await em.find(Book, {}, {
  orderBy: [
    { title: 1 },
    { author: { name: -1 } },
  ],
});

BREAKING CHANGE:
FindOptions.orderBy parameter is now strictly typed.

Closes #2010

`FindOptions.orderBy` parameter is now strictly typed. It also allows passing an
array of objects instead of just a single object.

```ts
const books = await em.find(Book, {}, {
  orderBy: [
    { title: 1 },
    { author: { name: -1 } },
  ],
});
```

Closes #2010
@B4nan B4nan merged commit 0ec22ed into master Sep 18, 2021
@B4nan B4nan deleted the order-by-array branch September 18, 2021 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order of multiple nested orderBy params
1 participant