how should I use the `AND` in a delete case? tryin...
# orm-help
j
how should I use the
AND
in a delete case? trying to do something like
Copy code
await prisma.like.delete({
  where: {
    AND: [
      {
        postId: postId
      },
      {
        userId: ctx.user.userId
      }
    ]
  }
})
โœ… 1
h
I think you can just do this in the top level here:
Copy code
await prisma.like.delete({
  where: {
    postId: postId,
    userId: ctx.user.userId
  }
})
๐Ÿ‘ 1
Let me know if this produces the desired result
c
I donโ€™t think you can, you can only use unique attributes in
delete
(and some others like
update
and
findUnique
) related: https://github.com/prisma/prisma/discussions/4185
v
๐Ÿ‘‹ Hey @juls07, did this ^^ answer your question or is it still open? Let us know!
j
Yep, thanks!
๐Ÿ’ฏ 1