We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3f230a commit 9d7d0c7Copy full SHA for 9d7d0c7
src/Jenssegers/Mongodb/Query/Builder.php
@@ -978,9 +978,13 @@ protected function compileWhereBasic(array $where)
978
{
979
extract($where);
980
981
- // Replace like with a Regex instance.
982
- if ($operator == 'like') {
983
- $operator = '=';
+ // Replace like or not like with a Regex instance.
+ if (in_array($operator, ['like', 'not like'])) {
+ if (Str::startsWith($operator, 'not')) {
984
+ $operator = 'not';
985
+ } else {
986
+ $operator = '=';
987
+ }
988
989
// Convert to regular expression.
990
$regex = preg_replace('#(^|[^\\\])%#', '$1.*', preg_quote($value));
0 commit comments