PinkiePie
04/10/2022, 4:53 PMPrisma.user.update({
where: {
id,
},
data: {
name: newName
}
});
results in lots of additional requests like
prisma:query db.AuthTokens.aggregate([ { $match: { $expr: { $and: [ { }, { $and: [ { $in: [ "$userId", [ "62530b0f4556cced19ce20c8", ], ], }, { $or: [ { $ne: [ { $ifNull: [ "$userId", null, ], }, null, ], }, { $eq: [ "$userId", null, ], }, ], }, ], }, ], }, }, }, { $project: { _id: 1, userId: 1, }, }, ])
prisma:query db.Posts.aggregate([ { $match: { $expr: { $and: [ { }, { $and: [ { $in: [ "$userId", [ "62530b0f4556cced19ce20c8", ], ], }, { $or: [ { $ne: [ { $ifNull: [ "$userId", null, ], }, null, ], }, { $eq: [ "$userId", null, ], }, ], }, ], }, ], }, }, }, { $project: { _id: 1, userId: 1, }, }, ])
I have one extra aggregation per every related collections. What's the purpose of that? Feels like it just slows the DB with no reason.janpio
janpio
janpio