hey all, using postgres and trying to get my head ...
# orm-help
p
hey all, using postgres and trying to get my head around: https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-scalar-lists-arrays Let’s say I have an array, that’s supposed to be a hierarchical structure, mapping to a directory list. When I traverse down the directory list. I can use the following:
where = { path: folderId !== null ? { has: folderId } : undefined }
But when I am at the root, I get all the files and folders. When I query in psql:
select id, name, path from dam_file where path is null;
Then I only get the data that’s at the root level of the directory. How do I ensure I am duplicating the psql for a Prisma query? Thanks
1
So { equals: null } does the trick.
1
where = { path: folderId !== null ? { has: folderId } : { equals: null } }
n
Glad to see that you were able to solve this 👍 Thanks for mentioning the solution, it will help other users who might run into this 🙌
👍 1