const user = await prisma.user.update({
where: {
email: '[email protected]',
},
data: {
posts: {
update: [
// a
{
data: { published: true },
where: { id: 32 },
},
// b
{
data: { published: true },
where: { id: 23 },
},
],
},
},
})
with specific ("manually implemented") go client syntax:
result, err := client.User.FindOne(
db.User.Email.Equals("[email protected]"),
).Update(
db.User.Posts.Update(
// a
User.Posts.FindOne(
User.ID.Equals(32),
).Update(
User.Published.Set(true),
),
// b
User.Posts.FindOne(
User.ID.Equals(32),
).Update(
User.Published.Set(true),
),
),
)
with inputTypes:
result, err := client.User.UpdateOne(
db.UserWhereUniqueInput(
db.UserWhereUniqueInputEmail("[email protected]"),
),
// data
db.UserUpdateInput(
// posts
db.PostUpdateManyWithoutAuthorInput(
// update (arr)
// a
db.PostUpdateWithWhereUniqueWithoutAuthorInput(
db.UserUpdateWithWhereUniqueInput(
db.PostWhereUniqueInput(
db.PostWhereUniqueInputID(32),
),
db.PostUpdateWithoutAuthorDataInput(
db.PostUpdateWithoutAuthorDataInputPublished(true),
),
),
),
// b
db.PostUpdateWithWhereUniqueWithoutAuthorInput(
db.UserUpdateWithWhereUniqueInput(
db.PostWhereUniqueInput(
db.PostWhereUniqueInputID(23),
),
db.PostUpdateWithoutAuthorDataInput(
db.PostUpdateWithoutAuthorDataInputPublished(true),
),
),
),
),
),
)