The MongoDB\BSON\Regex class
(mongodb >=1.0.0)
Введение
Обзор классов
MongoDB\BSON\Regex
implements
MongoDB\BSON\Type
{
/* Методы */
}Содержание
- MongoDB\BSON\Regex::__construct — Construct a new Regex
- MongoDB\BSON\Regex::getFlags — Returns the Regex's flags
- MongoDB\BSON\Regex::getPattern — Returns the Regex's pattern
- MongoDB\BSON\Regex::__toString — Returns the string representation of this Regex
Коментарии
Example
Find names that start with "Al"
$regex = new MongoDB\BSON\Regex ( '^Al');
$cursor = $collection->find(array('name' => $regex));
//iterate through the cursor
Refer the example at:
http://docs.php.net/manual/en/mongodb-bson-regex.construct.php#refsect1-mongodb-bson-regex.construct-examples