E.g. if I use something like `@@id([a, b])` , how ...
# orm-help
s
E.g. if I use something like
@@id([a, b])
, how can I do upserts on those models?
Specifically, identical to multi-field ID findOne
👍 1
s
Ah, nice, let me have a look 🙂
r
Something like this:
Copy code
await prisma.user.upsert({
    where: {
      name_email: {
        name: 'name',
        email: 'email',
      },
    },
    create: {
      email: 'email',
      name: 'name',
    },
    update: {
      age: 21,
    },
  })
Given this schema:
Copy code
model User {
  name  String
  email String
  age   Int?
  @@id([name, email])
}
s
Nice, will try. My typings are not suggesting a_b is valid on where.
r
Maybe restart your editor or generate Prisma again?
s
Hah, yeah, it was the former. I hate when this happens 😄 #vscode
🙌 1