我们已经安装了php mongo ext,然后设置了作曲者。php 7 mongodb集合插入
https://github.com/alcaeus/mongo-php-adapter
在我的PHP代码中,我这样的:
require_once 'vendor/autoload.php';
$m = new MongoDB\Client("mongodb://host1,host2", array ('replicaSet' => 'host-set-01'));
$document = array(....);
$db->mycollection->insert($document);
而且它返回此错误:
PHP Fatal error: Uncaught Error: Call to undefined method MongoDB\Collection::insert()
但是适配器的文件夹里面我看到insert()
该集合内class Mongo/MongoCollection.php
任何人都可以使用mongodb/adapter吗?
您能否为此问题发布正确的修补程序? – Nadeshwaran