php - Negate a $regex for mongodb in Yii2 -
i use $regex inside aggregation pipeline $match instruction in php. need find record "does not contain" string. i'v found out online $not operator used such cases, if try this:
$regex = "/.*".$sometext.".*"; $use['$not'] = $regex;
also 1 not work:
new \mongoregex("/.*".$sometext.".*") $use['$not'] = $regex;
in short need find text not contain string
Comments
Post a Comment