PrismaP
Prisma7mo ago
5 replies
Sam

Are deeply nested where clauses supported

Given the following example query:
    const testitems = await tx.A.findMany({
      where: {
        B: {
          some: {
            C: {
              is: {
                D: {
                  is: {
                    X: {
                      equals: 'Y',
                    },
                  },
                },
              },
            },
          },
        },
      },
    });

each item in the where clause is a related table of the previous item (A table related to B table related to C table etc. )
Should this work and my syntax is just wrong or is this not supported?
Was this page helpful?