question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preview feature feedback: Order by Relations support (`orderByRelation`)

See original GitHub issue

Please share your feedback about the orderByRelation functionality that was released in v2.16.0 in this issue.

  • If you encounter a bug, please open a bug report in this repo.
  • If the feature is working well for you, please share this in a comment below or leave a 👍 on this issue.

If you have any questions, don’t hesitate to ask them in the #prisma-client channel in the Prisma Slack.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
guerrerocarloscommented, Apr 23, 2021

The feature is working great, but if it could not only count the number of relations, but also sum, avg, min and max some specific attribute of the relations, it would make it a killer feature.

For example, a very common use case:

Top 10 students with the best grades

await prisma.students.findMany({
  take: 10,
  orderBy: {
    exams: {
      avg: {
        points: 'desc' 
      }
    }
  },
});
1reaction
2colorcommented, Sep 7, 2021

Closing this now that this has been released to General Availability in the 3.0.1 release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma Client and Prisma schema preview features
When we release a new Prisma Client or Prisma schema feature, it often starts in preview so that you can test it and...
Read more >
Ordering By Relation Aggregates with Prisma Client - YouTube
In this video, Ryan Chenkie demonstrates how to use the new order by relation aggregate feature using an Author model and its related...
Read more >
prisma Order by relation has only _count property. Can not ...
I'm adding a solution that uses the orderByRelation preview feature to simplify the sorting and ensure the messages in a conversation are ...
Read more >
Feedback on Preview Features - Microsoft Power BI Community
Solved: Just wondering how to feedback to developers on preview features. I've found a few things over the years that have't quite behaved ......
Read more >
prisma argument of type whereuniqueinput needs at least one ...
@relation( name: "AllCommentsOfUser" fields: [UserID] references: ... npx prisma db push --preview-feature; db push works, but then generation fails with:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found