有人可以帮助我修复此PHP MongoDB异常:
无法通过数据库“ Model”发送“ getMore”命令:套接字错误或超时
从查询到大量收藏(14密耳)。查询如下:
$options = [
'noCursorTimeout' => true,
'batchSize' => 50,
'projection' => ['dateFrom' => 1, 'dateTo' => 1, 'ico' => 1, 'city' => 1, 'address' => 1, 'name' => 1, 'type' => 1]
];
$docs = $this->mapper->getCollection()->find([
'$or' => [
['dateFrom' => ['$lte' => $bsonTo], 'dateTo' => NULL],
['dateFrom' => ['$lt' => $bsonFrom], 'dateTo' => ['$gte' => $bsonFrom]],
['dateFrom' => ['$gte' => $bsonFrom, '$lte' => $bsonTo]]
]
], $options);
我设置了noCursorTimemout + batchSize原因,起初我遇到Cursor not found异常。但是现在我有了这个。谢谢。