Reputation: 73
I'm quite new to both Scala and Slick. A "LIKE" query was easy to make
query.filter(_.name like "%kjelle%")
but I'm not successful trying to do a "NOT LIKE" query. Couldn't find a notlike operator so my first thought was to try
query.filter(_.name !like "%kjelle%")
or
query.filter(!(_.name like "%kjelle%"))
but no success.
How can I do it in Slick?
Upvotes: 7
Views: 1545
Reputation: 549
You can try to use filterNot
:
query.filterNot(_.name like "%kjelle%")
Upvotes: 7