Michael Jay
07/26/2022, 12:56 AMprisma.contact.createMany({
data: [
{
...contact attrs,
tags: {
create: {...}
}
}
]
})
and so forth. But it looks like that's only possible for create.
so I'm guessing my two options are:
1. CreateMany the contacts, then match them back up with the input to get the right ID on the related records
2. Create (single) each contact with its related records in place. Maybe in a transaction/ Promise all.
Am I missing something - are those my two options?Aladin
07/26/2022, 1:02 AMNurul
07/26/2022, 2:22 PMcreate, createMany, connect, connectOrCreate inside a top-level createMany
But you can nest a createMany inside a create query.
I would suggest creating a single record with its related records.Michael Jay
07/26/2022, 2:27 PM