bntzio
12/28/2020, 9:56 PMconnectOrCreate query in a many-to-many (explicit) relation.
tags: {
connectOrCreate: {
where: { name: 'General' },
create: { tags: { create: { name: 'General' } } }
}
}
Many thanks!bntzio
12/28/2020, 9:58 PMid in the where, example:
tags: {
connectOrCreate: {
where: { id: 1 },
create: { tags: { create: { name: 'General' } } }
}
}bntzio
12/28/2020, 9:59 PMconnectOrCreate I might not have an idbntzio
12/28/2020, 10:03 PMbntzio
12/28/2020, 10:06 PMid in the where :bntzio
12/28/2020, 10:07 PMbntzio
12/28/2020, 10:09 PMid so what I want is to create or connect a new tag record.
It may work only for connect but not for create or connectOrCreate .