Wahyu
05/30/2022, 1:37 AMfindMany where the entity is not referenced by any other entity.
I have a model called RenewalStorage that is a pivot table between Renewal <-> Storage models, I want to find Storage that is not referenced in any RenewalStorageKasir Barati
05/30/2022, 8:33 AMawait this.prisma.tableName.findMany({
where: {
fieldName: {
equals: null
}
}
})Wahyu
05/30/2022, 9:23 AMfindMany({
where: {relation: {none: {id: {gt: -1}}}
})
it finds any relation that has an id greater than -1 which is impossible to satisfy if you have any relation because the id will always be a positive number.