我尝试来自 php.net 的示例:- http://php.net/manual/en/class.mongodb-bson-regex.php
在 php 中执行以下代码时
$regex = new MongoDB\BSON\Regex ( '^Al');
$cursor = $collection->find(array('name' => $regex));
//iterate through the cursor
然后 php 显示错误类 'MongoDB\BSON\Regex' 未找到 请帮我如何解决这个问题
最佳答案
您可能会发现只有 Eclipse 将其标记为问题,但当您在 Web 服务器上运行它时,一切正常。
如果是这种情况,那么您的答案就在这里: How to have eclipse resolve php classes in MongoDB\BSON namespace?
关于php - 未找到类 'MongoDB\BSON\Regex',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40058053/