Hussam Khatib
08/13/2022, 4:20 AMOR
filter in where clause in such way that the first condition in OR
is checked throughout the db and if it does not exist try with the second one.
const result = await prisma.findFist({
where:{
OR:[
{"condition 1"},{"condition 2"}
]
}
})
If filter condition 1 is not matched with any record , then only try for condition 2Nurul
08/16/2022, 9:09 AMcondition 1
and based on the response of the first query, whether the second query should be invoked or not could be decided.Vladi Stevanovic