Rain
08/14/2022, 7:13 PMset: []
to disconnect all related records.
Will this work ?
prisma.user.create({
data: {
name: 'test',
likes: {
set: [],
connect: [{ name: 'a'}, {name: 'b'}]
}
});
Raphael Etim
08/15/2022, 10:31 AMconst updateUser = await prisma.user.update({
where: {
id: 16
},
data: {
posts: {
set: []
}
},
include: {
posts: true
}
})
This results in the output
{
id: 16,
name: null,
email: '<mailto:orla@prisma.io|orla@prisma.io>',
profileViews: 0,
role: 'USER',
coinflips: [],
posts: []
}
Check out the docs for more information on this.Rain
08/15/2022, 10:58 AMRain
08/16/2022, 8:03 AMRaphael Etim
08/16/2022, 8:55 AMRain
08/16/2022, 8:59 AM