Is there a more elegant way to filter a relational...
# orm-help
d
Is there a more elegant way to filter a relational field in prisma instead of this:
Copy code
where: {
  AND: [
    ...categories!.map((value) => ({ categories: { some: { description: { contains: value } } } })),
  ]
},
and no, some or every will not suffice (at least not in its most basic form) hasEvery would be preferable but it seems to only be available to scalar fields or mongodb relations (I use postgresql)
m
So my solution is not elegant? 🤕😅
d
not quite 😄 it works but it seems less than ideal. But I fear it's the best prisma has to offer
sorry 😄 (thankful for it nonetheless)
m
I have a different nickname than Nextjs discord... 😉
d
it's ok 😄 I'm not trying to hide it
I like your pb tho because I kinda doubted you xD