Quantcast
Viewing latest article 12
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 latest article 12
Browse Latest Browse All 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>