note 124177 added to mongodb-bson-regex.construct
| From: | AlejandroWilcke@php.net | Date: | Fri, 06 Sep 2019 14:32:34 +0000 |
| Subject: | note 124177 added to mongodb-bson-regex.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-212107@lists.php.net to get a copy of this message | ||
This matches with any fieldName that includes the string:
$mongoRegex = new MongoDB\BSON\Regex("$string", "i");
This matches with any fieldName that STARTS with the string:
$mongoRegex = new MongoDB\BSON\Regex("^$string", "i");
$cursor = $collection->find( [ 'fieldName' => $mongoRegex ] );
$docs = [];
foreach($cursor as $doc){
$docs[] = $doc;
}
return $docs;
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.54 (proxied: 2800:810:101:201:41e8:e24a:c8eb:8408)
----
Manual Page -- http://php.net/manual/en/mongodb-bson-regex.construct.php
Edit -- https://master.php.net/note/edit/124177
Del: integrated -- https://master.php.net/note/delete/124177/integrated
Del: useless -- https://master.php.net/note/delete/124177/useless
Del: bad code -- https://master.php.net/note/delete/124177/bad+code
Del: spam -- https://master.php.net/note/delete/124177/spam
Del: non-english -- https://master.php.net/note/delete/124177/non-english
Del: in docs -- https://master.php.net/note/delete/124177/in+docs
Del: other reasons-- https://master.php.net/note/delete/124177
Reject -- https://master.php.net/note/reject/124177
Search -- https://master.php.net/manage/user-notes.php