申请详情: 我正在开发一个Web应用程序,其中我使用php作为服务器端语言,使用mongodb作为数据库。我正在使用php mongodb库连接mongodb数据库。
问题: 我可以使用mongoDB库从后端成功创建数据库连接。但是当我运行查询查询时,我收到以下错误消息:
致命错误:未捕获的异常 带有消息'命名空间的'MongoDB \ Driver \ Exception \ RuntimeException' 不能嵌入空字符 C:\ wamp64 \ WWW \ analytic_script \供应商\ MongoDB的\ MongoDB中的\ src \工作\ Find.php 在第180行
任何人都可以告诉我可能的解决方案。这是发生错误的find.php函数。
public function execute(Server $server)
{
$readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null;
**// Error is occuring at this line**
$cursor = $server->executeQuery($this->databaseName . '.' . $this->collectionName, $this->createQuery(), $readPreference);
if (isset($this->options['typeMap'])) {
$cursor->setTypeMap($this->options['typeMap']);
}
return $cursor;
}
答案 0 :(得分:0)
升级php7扩展mongodb 1.1.1 => mongodb 1.5.3