P
Prisma16h ago
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 },
},
});
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
1 Reply
Prisma AI Help
Prisma AI Help16h ago
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!

Did you find this page helpful?