错误:Mongo服务器和Meteor查询不同意有多少文档与您的查询匹配。也许它正在打一个Mongo边缘案例?查询是:{}

时间:2018-03-19 07:25:32

标签: javascript node.js mongodb meteor meteor-blaze

Exception in defer callback: Error: The Mongo server and the Meteor query disagree on how many documents match your query. Maybe it is hitting a Mongo edge case? The query is: {}
I20180319-12:18:14.344(5.5)?     at packages/mongo/oplog_observe_driver.js:881:15
I20180319-12:18:14.345(5.5)?     at Object.Meteor._noYieldsAllowed (packages/meteor.js:730:12)
I20180319-12:18:14.345(5.5)?     at OplogObserveDriver._publishNewResults (packages/mongo/oplog_observe_driver.js:851:12)
I20180319-12:18:14.345(5.5)?     at OplogObserveDriver._runQuery (packages/mongo/oplog_observe_driver.js:758:10)
I20180319-12:18:14.346(5.5)?     at OplogObserveDriver._runInitialQuery (packages/mongo/oplog_observe_driver.js:658:10)
I20180319-12:18:14.346(5.5)?     at packages/mongo/oplog_observe_driver.js:191:10
I20180319-12:18:14.346(5.5)?     at packages/mongo/oplog_observe_driver.js:15:9
I20180319-12:18:14.346(5.5)?     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:26)
I20180319-12:18:14.347(5.5)?     at packages/meteor.js:502:25
I20180319-12:18:14.347(5.5)?     at runWithEnvironment (packages/meteor.js:1238:24)

这是我得到的完全例外,它开始出现,因为我将流星从1.6.0更新到1.6.1,因为代码更改刚刚更新我的流星,我无法将代码显示为它是保密的,但有些人可以给我任何暗示我应该查看我的代码的哪一部分:例如:助手,流星呼叫,流星方法,路由器等。

或者任何机构都可以告诉我为什么会出现这个错误。

1 个答案:

答案 0 :(得分:1)

如果您还没有找到解决方案:

此错误来自Mongo和JSON / EJSON中undefined值的处理。

因为JSON中不存在undefined,所以键值对在传递给Mongo之前会从查询中删除。这就是错误The query is: {}

的原因

Meteor在下一版本的管道中对此进行了修复,但与此同时,您可以更新受影响的查询以测试未定义并将其替换为null

参考:https://github.com/meteor/meteor/issues/9619