MongoDB : CursorNotFound 在查询过程中



我正在使用MongoDB shell version: 3.0.7,并且在长查询(Double forEach ~30k*230k条目)的中间,查询停止,我得到了CursorNotFound

这是查询。

db.EUCtrCopy.find().forEach(function (data){
db.USFull.find({$or:[{"clinical_study.brief_title" : data.ASection.FullTitle },{"clinical_study.official_title" : data.ASection.FullTitle },{"clinical_study.id_info.org_study_id" : data.ASection.SponsorProtocolNumber}]}).forEach(function (val) {
db.USEUOverlap.insert({"USId": val._id, "EUId" : data._id})
print("It's a match ! ("+data._id+")");
});
});

我读到当你在MongoDB Shell中闲置时,你可能会遇到CursorNotFound问题。但它发生在查询的中间。 我怎样才能读到这个错误?

谢谢。

将聚合用于EUCtrCopy集合 通过提供本地字段和外部字段,将USFull与一个字段一起使用$lookup然后添加$filter以在此管道中执行其余条件 最后将$out管道与USEUOverlap一起使用,将结果作为集合获取

供参考$filter $lookup

最新更新