Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

janoveoyen
Copy link

Added a note for orderBy to point out that you can only order by the model's own field.

Type of PR:

  • Documentation

Breaking changes:

  • No
  • Yes

Details

Added a note for orderBy to point out that you can only order by the model's own field.

Added a note for orderBy to point out that you can only order by the model's own field.
@janoveoyen janoveoyen marked this pull request as ready for review August 25, 2020 09:36
@cuebit cuebit self-assigned this May 6, 2021
@cuebit cuebit added the documentation The issue is about documentation label May 6, 2021
Copy link
Member

@cuebit cuebit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification! Added a comment, once reviewed this can be merged 👍

*/
```

> **NOTE:** orderBy can only order by fields that are native to the model that you are running .query() on. If you want to order by a related model's fields, you have to .sort() the result of the query using your own comparator.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reword this to make it a little less assertive?

NOTE:orderBy will order by fields that are native to the model on the currently running query. If you want to order by a related model's fields, you will need to apply sort using your own comparator on the final query result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is about documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants