The MongoDB\BSON\Regex class

(mongodb >=1.0.0)

Вступ

Короткий Огляд Класа

MongoDB\BSON\Regex implements MongoDB\BSON\Type {
/* Методи */
public __construct ( string $pattern , string $flags )
public ReturnType getFlags ( void )
public ReturnType getPattern ( void )
public ReturnType __toString ( void )
}

Зміст

add a note add a note

User Contributed Notes 2 notes

up
-28
aws dot htc at gmail dot com
7 years ago
Example
Find names that start with "Al"

$regex = new MongoDB\BSON\Regex ( '^Al');
$cursor = $collection->find(array('name' => $regex));
//iterate through the cursor
To Top