Skip to content

Instantly share code, notes, and snippets.

@nmchenry01
Created August 13, 2020 23:22
Show Gist options
  • Select an option

  • Save nmchenry01/7000b1048191123aab11d2d39afd8df1 to your computer and use it in GitHub Desktop.

Select an option

Save nmchenry01/7000b1048191123aab11d2d39afd8df1 to your computer and use it in GitHub Desktop.
Multiple filters example for "Prisma vs. TypeORM"
const findCompaniesThatMakeCarsOrDynamite = async (prisma: PrismaClient) => {
return prisma.company.findMany({
where: {
OR: [
{
products: {
some: {
name: 'Car',
},
},
},
{
products: {
some: {
name: 'Dynamite',
},
},
},
],
},
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment