how do you test for array inclusion; given a schem...
# orm-help
d
how do you test for array inclusion; given a schema
Copy code
model states {
    id                                   String @id
    hindexes                            String[]
    administrative_area_level           Int
    administrative_area_level_1         String
    administrative_area_level_2         String
}
If I want to find all states that include a given string in hIndexes, what does the โ€œwhereโ€ look like?(postgres FWIW)
โœ… 1
n
It seems you are looking for has filter operator. Can you have a look at it?
Copy code
await prisma.states.findMany({
    where: {
      hindexes: {
        has: 'search_string',
      },
    },
  });
v
๐Ÿ‘‹ Hello @Dave Edelhart, did you have a chance to see Nurul's comment? Let us know if that solution helps!
d
ah yes super thanks
๐Ÿ’ฏ 1
n
Glad to hear! ๐Ÿ™Œ