hello guys!! can anyone help me with this problem?...
# orm-help
a
d
I think what it’s saying is
authorId
is not setup as a unique field, so multiple patients could have the same
authorId
and that’s why you can’t update off of it. The only uniques you have in
Patient
right now are
id
and
email
.
r
Hi @Arpit Satyal, Just like @Dave Rupert mentioned, you can only update through the unique fields
id
and
email
.
Copy code
type PatientWhereUniqueInput {
  id?: Int
  email?: String
}
but to able to perform the update on any of the field, you can use
updateMany
. For example:
Copy code
const updatedPatient = await prisma.patient.updateMany({
  where: {
    authorId: 1 ,
  },
  data: {
    firstName: 'William'
  },
});
Also you can find a similar issue where this was discussed here
a
thanks alot @Raphael Etim
r
You're welcome.