Order results by a nested relation's DateTime with Prisma
I have a
Conversation
model which has one-to-many relationship with Message
s. I want to order the conversations by the most recent message, but it seems Prisma doesn't have a way to do this??? I need pagination so I can't do this after querying either, so is my only solution to write the SQL myself? I get the love for Prisma, but there are so many things missing 🙃2 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That's the other way around
Using that example I would want to sort an author by their latest post
I had to do
I suck at SQL so I have no idea if this is correct or not but it seems to work (haven't tried the pagination part yet)