mongodb - 尝试使用 Mongo 查询加入(查找)两个集合,但它给我一个错误
问题描述
我写了一个 mongodb 查询并尝试使用 Mongo 查询加入(查找)两个集合,但它给我一个错误,说最大文档大小超出。在有 150 个文档但无法处理 290 万个文档的小型集合上运行相同的查询。我需要这方面的帮助。
我正在为 MongoDB 2018.6.1 IDE 使用 Studio 3T
db.collection.aggregate([
{
$lookup: {
from: "collection2",
localField: "id",
foreignField: "id",
as: "joined_data"
}
}
])
无法执行选定的命令
Mongo Server error (MongoCommandException): Command failed with error 4568 (Location4568): 'Total size of documents in collection2 matching pipeline { $match: { $and: [ { id: { $eq: null } }, {} ] } } exceeds maximum document size' on server 168.152.169.555:27017.
完整的回应是:
{
"ok" : 0.0,
"errmsg" : "Total size of documents in collection2 matching pipeline { $match: { $and: [ { id: { $eq: null } }, {} ] } } exceeds maximum document size",
"code" : NumberInt(4568),
"codeName" : "Location4568"
}
解决方案
推荐阅读
- javascript - 如何删除角度的自动对焦?
- r - plot_summs() 改变绘制回归系数的大小
- html - ./ 和 ../ 目录差异
- r - 无法使用 readOGR 加载 shapefile - ogrinfo:所有功能 NULL
- ruby-on-rails - 带有捕获的 Ruby Regexp#match 返回字符串而不是 MatchData
- scala - 对 scala 类型推断和类型不变性感到困惑
- r - 在 sqldf 中处理 CSV 文件中的逗号
- pycharm - PyCharm 没有为另一个 numpy 数组上的方法返回的 numpy 数组提供建议
- javascript - 如何在 Javascript 代码中更改数据库值,但不允许用户在 Javascript 控制台中更改(或访问)数据库值?
- react-native - 无法在 react-native-navigation 中的抽屉上使用 redux