David Ilizarov
06/21/2021, 9:04 AMconnect
and update the connecting relation at the same time?
Kinda like how you can use create
to create a new relation.
const createPost = await prisma.post.create({
data: {
title: "How to make croissants",
author: {
create: {
email: "<mailto:viola@prisma.io|viola@prisma.io>",
name: "Viola"
}
}
}
})
I kinda want the same, but like...
const createPost = await prisma.post.create({
data: {
title: "How to make croissants",
author: {
connect: {
id: 10,
data: {
email: "<mailto:viola@prisma.io|viola@prisma.io>",
name: "Viola"
}
}
}
}
})
I know that exact API is not available, but is there something simlar?Ryan
06/22/2021, 6:35 AMtransaction
.David Ilizarov
06/22/2021, 2:41 PMconnectAndUpdate
haha. Similar to connectOrCreate
.