Join Slack
Communities
Powered by
How can I select all Users which have 0 Posts?
# orm-help
e
Eden Lane
01/07/2021, 3:39 PM
How can I select all
Users
which have 0
Posts
?
✔️ 1
Eden Lane
01/07/2021, 5:27 PM
Okay, I've created the view in my MySQL DB but prisma always returns empty array when I do findMany
r
Ryan
01/08/2021, 7:25 AM
Hey
@Eden Lane
👋 This should fetch the Users with 0 Posts:
Copy code
await prisma.user.findMany({ where: { posts: { none: {} } }, })
e
Eden Lane
01/08/2021, 8:21 AM
awesome, thanks!
💯 1
7
Views
Open in Slack
Previous
Next