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?
You can try to use filterNot
:
query.filterNot(_.name like "%kjelle%")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With