PrismaP
Prisma13mo ago
12 replies
MinatoTW

Check array contains

Hello, what's the correct way to check if an array doesn't have a value? I'm doing this right now but it's not working:

          await tx.player.update({
            select: { id: true },
            where: {
              user_id: id,
              level: { gte: trait.unlockLevel },
              NOT: {
                left_traits: { has: level },
                right_traits: { has: level },
              },
            },
            data: {
              [`${side.toLowerCase()}_traits`]: { push: level },
            },
          });


Both are Int[] arrays and are empty right now, so this should work I think
Was this page helpful?