来自setTimeout回调的异常:{stack:[Getter]}和Mongo错误

时间:2013-08-19 21:58:23

标签: meteor meteorite node-fibers

我正在抛出以下异常:

=> Meteor server restarted
I20130820-00:17:58.852(3)? Exception from setTimeout callback: { stack: [Getter] } MongoError: $or requires nonempty array
I20130820-00:17:58.852(3)?     at Object.Future.wait (/home/alexei/.meteor/tools/4010e5731d/lib/node_modules/fibers/future.js:326:15)
I20130820-00:17:58.853(3)?     at _.extend._nextObject (packages/mongo-livedata/mongo_driver.js:540)
I20130820-00:17:58.853(3)?     at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:570)
I20130820-00:17:58.853(3)?     at _.extend.map (packages/mongo-livedata/mongo_driver.js:582)
I20130820-00:17:58.853(3)?     at _.extend.fetch (packages/mongo-livedata/mongo_driver.js:606)
I20130820-00:17:58.853(3)?     at _.each.Cursor.(anonymous function) [as fetch] (packages/mongo-livedata/mongo_driver.js:444)
I20130820-00:17:58.854(3)?     at MongoConnection.findOne (packages/mongo-livedata/mongo_driver.js:362)
I20130820-00:17:58.854(3)?     at _.extend.findOne (packages/mongo-livedata/collection.js:225)
I20130820-00:17:58.854(3)?     at _.extend.findOne (packages/collectionFS/collectionFS_common.js:4)
I20130820-00:17:58.855(3)?     at _.extend.checkQueue (packages/collectionFS/collectionFS_filehandlers.js:95)
I20130820-00:17:58.855(3)?     - - - - -
I20130820-00:17:58.855(3)?     at Object.toError (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
I20130820-00:17:58.855(3)?     at Cursor.nextObject.self.queryRun (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:54)
I20130820-00:17:58.856(3)?     at Cursor.close (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:903:5)
I20130820-00:17:58.856(3)?     at Cursor.nextObject.commandHandler (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/cursor.js:634:21)
I20130820-00:17:58.856(3)?     at Db._executeQueryCommand (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/db.js:1658:9)
I20130820-00:17:58.856(3)?     at Server.Base._callHandler (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/base.js:378:41)
I20130820-00:17:58.856(3)?     at Server.connect.connectionPool.on.server._serverState (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:468:18)
I20130820-00:17:58.857(3)?     at MongoReply.parseBody (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
I20130820-00:17:58.857(3)?     at Server.connect.connectionPool.on.server._serverState (/home/alexei/.meteor/packages/mongo-livedata/86ae77f282/npm/node_modules/mongodb/lib/mongodb/connection/server.js:426:20)
I20130820-00:17:58.857(3)?     at EventEmitter.emit (events.js:96:17)

请告知,导致问题的原因是什么?

我在0.6.5流星,0.6.6 mrt,0.10.13节点和1.3.2 npm。

顺便说一下,应用程序本身运行良好:)

请告知。

谢谢,

克塞

1 个答案:

答案 0 :(得分:2)

Meteor.setTimeout代码块中的查询包含一个$or关键字,其中包含一个空数组。您需要至少有两个项目才能进行操作。

如果您遇到问题/使用某种方式构建$or查询,您可以使用此代码块更新代码,以便我们提供进一步的帮助