【发布时间】:2016-07-20 11:34:57
【问题描述】:
我的 Meteor 1.2.1 程序在 find().forEach() 循环中抛出了 MongoError: cursor killed or timed out,所以我发现 this page 说这段代码可以防止:
var myCursor = db.users.find().noCursorTimeout()
但是,driver docs 和我的 Meteor 说该方法不存在:Object [object Object] has no method 'noCursorTimeout'
根据this comment,Mongo autoReconnect 是 enabled by default 并没有帮助,Meteor forum 甚至 .find({}, {timeout:false}) 也没有帮助。
2016-07-20 11:21:37 更新开始
2016-07-20 11:37:21 调用方法 'updateCollections' MongoError 时出现异常:游标被杀死或超时
也许 Meteor 在 2016-07-20 09:34:57 被失败的 SOAP 调用弄糊涂了?
"error": {
"errno": "ETIMEDOUT",
"syscall": "connect",
"code": "ETIMEDOUT"
},
【问题讨论】:
-
你认为光标对象的
maxTimeMS方法会有帮助吗?你试过了吗? -
cursor.maxTimeMS(5000)结果为Object [object Object] has no method 'maxTimeMS'。 Windows 10 上的 MongoDB server 3.2 可以理解,但 Meteor 1.2.1 不理解。版本文件说 mongo@1.1.3 所以我会尝试更新它。 -
重新添加 mongo 包保持 Meteor 版本为 mongo@1.1.3。
标签: javascript mongodb meteor