migz
06/09/2021, 3:50 PMconnectOrCreate on an array? similar to this, but instead creating the record if it doesn't exist
data: {
email: '<mailto:vlad@prisma.io|vlad@prisma.io>',
posts: {
connect: [{ id: 8 }, { id: 9 }, { id: 10 }],
},
},Samrith Shankar
06/09/2021, 3:55 PMwhere: { email: '<mailto:alice@prisma.io|alice@prisma.io>' },
data: {
posts: {
connectOrCreate: [
{
where: { id: 32 },
create: { title: 'This is my first post' },
},
{
where: { id: 19 },
create: { title: 'This is my second post' },
},
],
},
},migz
06/09/2021, 4:08 PM