I want to query something with SQL\'s like query:
like
SELECT * FROM users WHERE name LIKE \'%m%\'
How to do I achieve the same in
MongoRegex has been deprecated. Use MongoDB\BSON\Regex
$regex = new MongoDB\BSON\Regex ( '^m'); $cursor = $collection->find(array('users' => $regex)); //iterate through the cursor