摘要:
selectDB($dbname); $mongoDB->authenticate($user, $pwd); /*接下来就可以对该库上的集群进行操作了,具体操作方法请参考php-mongodb官方文档*/ $mongoCollection = $mongoDB->selectCollection('test'); $array = array( 'key1' => 'value1', ); $ret = $mongoCollection->insert($array); $mongoCursor = $mongoColl 阅读全文