Tyler Clendenin
10/11/2021, 12:22 AMcreateMany and create with an array of objects?Ricky Hopkins
10/11/2021, 12:32 AMcreate, I thought you had to use createMany.
I have been trying to create deeply nested data and one thing that createMany will not let you do is pass more nested data to it. After a bit of testing I can do this:
prisma.parent.create({
data: {
name: "parent",
children: {
create: [
{
name: "child 1",
children: { create: [{ name: "grandchild 1" }] },
},
{ name: "child 2", },
],
},
},
});
But that will not work with createManyTyler Clendenin
10/11/2021, 12:44 AMTyler Clendenin
10/11/2021, 12:45 AM