Quantcast
Viewing all articles
Browse latest Browse all 48

Answer by Albert s for How to query MongoDB with "like"?

MongoRegex has been deprecated.
Use MongoDB\BSON\Regex

$regex = new MongoDB\BSON\Regex ( '^m');
$cursor = $collection->find(array('users' => $regex));
//iterate through the cursor

Viewing all articles
Browse latest Browse all 48

Trending Articles