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

Update retrieving.md #674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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 👍

@@ -288,6 +288,9 @@ const users = User.query().orderBy(user => user.name[2]).get()
*/
```

> **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.

None yet

2 participants