Moymat
Explore posts from serversPPrisma
•Created by Moymat on 5/30/2024 in #help-and-questions
Prisma ORM returns two different results from two similar (?) queries
I figured it out. In the first query, if
OR
doesn't have any filter (if groupIds
is undefined
), it returns an empty list. That's not the case for the second one since the other fields are present.4 replies
PPrisma
•Created by Moymat on 5/30/2024 in #help-and-questions
Prisma ORM returns two different results from two similar (?) queries
After writing that, I noticed that the issue only appears for the first query if
groupIds
is undefined, not if I give it an array of ids.4 replies
PPrisma
•Created by Moymat on 5/30/2024 in #help-and-questions
Prisma ORM returns two different results from two similar (?) queries
The goal of the query is to find all
alert
s which, for example, have is_deleted = false
, type = 'urgent'
and were instered between 2024-05-01
and 2024-05-30
. They also either have to have a one-to-many relation with a group
which id is in groupIds
(ex: [1, 2, 3]
) (group_id: { in: [1, 2, 3] })
or a many-to-many relation with groups
(groups : { some : { group_id : { in : [1, 2, 3] } } }
).
Also, groupIds
could be undefined
, which should ignore the OR
clause if I'm not mistaken.4 replies