Maybe it's a really dumb question, but how should I push a value to an array field when upserting? I tried to search for it but couldn't find this in their documentation.
This is my schema:
model Chat {
id Int @default(autoincrement()) @id
type Service[]
chatId String @unique
}
And this is the code I'm trying to use to update the array to push an item to it:
const chatDb = await prisma.chat.upsert({
where: {
chatId: String(ctx.chat.id),
},
create: {
chatId: String(ctx.chat.id),
type: { set: ['GRAYSCALE'] },
},
update: {
type: { set: ['GRAYSCALE'] },
},
});
How I am using right now, I'm substituting the type array for the ['GRAYSCALE'] array. I want to push the GRAYSCALE item to the array, and not substitute it.
How should I proceed?