I trying example from php.net: -http://php.net/manual/en/class.mongodb-bson-regex.php
when performing a code below in php
$regex = new MongoDB\BSON\Regex ( '^Al');
$cursor = $collection->find(array('name' => $regex));
//iterate through the cursor
then php show me error Class 'MongoDB\BSON\Regex' not found please help me how can i solve this query
You may find that only Eclipse is marking it as a problem, but when you run it on the web server it is fine.
If this is the case then your answer is here: How to have eclipse resolve php classes in MongoDB\BSON namespace?