Uncaught TypeError:传递给MongoDB \ Driver \ Server :: executeQuery()的参数3必须是MongoDB \ Driver \ ReadPreference的实例,

时间:2018-07-31 10:54:25

标签: php mongodb

Mongo数据库2.6版 php mongodb扩展版本1.1.5

$m= new MongoDB\Client("mongodb://127.0.0.1/");
$db = $m->mydb;
$collection = $db->mycollection;
$result = $collection->find();

它会产生错误

 Uncaught TypeError: Argument 3 passed to MongoDB\Driver\Server::executeQuery() must be an instance of MongoDB\Driver\ReadPreference

但是相同的代码在 Mongo版本3.4 php扩展1.5.1

然后为什么它在我的配置中不起作用

0 个答案:

没有答案