tminglei/slick-pg

Filtering by existence of all values in a set, in a set of objects

marioaae opened this issue · 0 comments

Hi everyone,
I'm very new to slick and I'm stuck trying to do a filter.

In scala, I have the following Set[String]:

["providerA", "providerB"]

And the following Rep[JsValue]:

[{"provider": "providerA", "id": "abc"}, {"provider": "providerB", "id": "zdf"}]
[{"provider": "providerA", "id": "tqr"}]
[{"provider": "providerB", "id": "xgu"}]

I would like to filter/find the rows which have all the providers from the Set[String] (providerA and providerB). In this case only the first row would be part of the result. The id in this case is irrelevant to the filter.

Thanks for your help!