Last active
August 13, 2020 23:04
-
-
Save nmchenry01/c9af7895e059418b790decffdb8f27a6 to your computer and use it in GitHub Desktop.
Find customer usernames for a specific company example for "Prisma vs. TypeORM"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const findCustomerUsernamesForCompany = async (prisma: PrismaClient) => { | |
| return prisma.customer.findMany({ | |
| select: { | |
| username: true, | |
| }, | |
| orderBy: { | |
| username: 'desc', | |
| }, | |
| where: { | |
| products: { | |
| some: { | |
| company: { name: 'Acme' }, | |
| }, | |
| }, | |
| }, | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment