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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -