mongo-sql
mongo-sql copied to clipboard
Can't figure out how to do NOT LIKE
I'm trying to figure out how to do name NOT LIKE '%test%' but I can't quite get it to work. Any ideas?
Some things that I have tried:
name: { $notLike: "%test%" }
name: { $nLike: "%test%" }
name: { $not: { $like: "%test%" } }
name: { $like: { $not: "%test%" } }
Am i missing something obvious? :)
Unfortunately, you'll need to register a conditional helper seen here http://mosql.j0.hn/#/snippets/ae
I'd happily accept a PR to add $notLike and $notILike to the built-in conditional helpers :)
Otherwise, I can get to it when I get to it
oh and if all else fails:
name: { $custom: ['name not like $1', '%test%'] }
Awesome, quick to answer as always 🙌
I'd be happy to whip up a PR for $notLike and $notILike :)