mongodb - Mongodb + PHP 无法使用数据库“Czechia”发送“find”命令:无法读取 4 个字节:套接字错误或超时
问题描述
我有一个 PHP 脚本,它应该将大约 200 万个项目从 MongoDB 发送到 Elasticsearch。有一个循环,其中一次迭代需要向查询简单调用的 MongoDB 发出 4 个请求
{"ico": {$in: [here are 50 items]}}
// collection has about 2M items and ico is indexed
但它仍然以这个错误结束Failed to read 4 bytes: socket error or timeout - MongoDB version is 4, PHP version 7.1。
这意味着什么?如果集合有大约 200 万个项目,那么 50 个带有 $in 查询的项目是否太多?如何解决?
解决方案
推荐阅读
- linux - 使用“snap install microk8s --classic”安装 microk8s 失败
- python - 为什么 click_and_hold 方法不选择段落开头的文本?
- javascript - Javascript 在从 javascript 附加的 html 上无法通过 id 找到元素
- firebase - 获取与用户 ID 匹配的用户帖子:Flutter
- python - 在电报机器人中从 php url 发送照片
- javascript - 如何在 express.static 中提取请求标头
- macos - Visual Studio mac 滚动问题
- excel - DoubleClick 后返回原始单元格时出现受保护的单元格警告
- docker - 构建较旧的 TensorFlow 2.x
- .net - 我可以更改 Nuget/Paket 包的安装位置吗?