Quick question - Would anyone know if the relation...
# orm-help
s
Quick question - Would anyone know if the relation queries “disconnect” and “connectOrCreate” are case sensitive? As an example, would the following work without causing errors?
Copy code
await prisma.post.update({
  where: { id: 'xxx' },
  data: {
    tags: {
      disconnect: [
        // disconnect tag with uppercase
        { label: "World" }
      ],
      connectOrCreate: [
        // connect or create tag full lowercase
        {
          where: { label: "world" },
          create: { label: "world" }
        }
      ]
    }
  }
})
1
Answering my own question here:
disconnect
and
connectOrCreate
appear to be case-insensitive. The example query I wrote is not returning any error - however, under the hood, it would simply disconnect and then reconnect to the same tag.
💯 1