I’m having an odd issue with the documentation not...
# prisma-client
m
I’m having an odd issue with the documentation not necessarily matching reality… Any help?
Copy code
await prisma.model.update({
      where: {
        model_id: {
          not: +model.model_id,
        },
      },
      data: {
        is_archived: true
      },
    });
errorInvalid `prisma.model.update()` invocation:{where: {model_id: {not: 7}~~~~~~~~},data: {is_archived: true}}Argument model_id: Got invalid value{not: 7}on prisma.updateOnemodel. Provided Json, expected Int
1
From the documentation this appears to be valid:
Copy code
<https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#not>

const result = await prisma.user.findMany({
  where: {
    name: {
      not: 'Eleanor',
    },
  },
})
Are these operators not allowed on updates?
I’ll leave this here just in the event someone else hits this; you cannot do this on an
update
but only
updateMany
. We knew that only a single item would be in this state which was why we were using
update
but have since switched to
updateMany
and that has resolved the issue.
👍 2