1

我正在使用 MeteorJS,我发现每当我尝试访问 MongoDB 记录的属性时,我都会在控制台中得到以下转储
Exception from Deps recompute: TypeError: Cannot call method 'firstNode' of undefined at Object.Spark.renderToRange (http://localhost:2000/packages/spark/spark.js? 14a6d0456c829f0ae6b6b21c3d85c12b51d07167:545:25) at null._func (http://localhost:2000/packages/spark/spark.js?14a6d0456c829f0ae6b6b21c3d85c12b51d07167:866:13) at _.extend._compute (http://localhost:2000/packages/deps/deps.js?00c1c175771f1d01cbad3013d682a68610670394:126:14) at _.extend._recompute (http://localhost:2000/packages/deps/deps.js?00c1c175771f1d01cbad3013d682a68610670394:139:16) at _.extend.flush (http://localhost:2000/packages/deps/deps.js?00c1c175771f1d01cbad3013d682a68610670394:222:16) logging.js:41

这是代码粘贴http://fpaste.org/7OC2/

4

1 回答 1

1

当流星完成订阅并从服务器获取数据时,在很短的时间内,集合是空的。

所以这个查询:

var result = QoD.findOne({week: Session.get('currentWeek')});

还不会有任何结果。如果没有任何结果,您只需要处理这种情况:

if(result) Session.set('allResponses', result.responses); 
于 2013-03-25T11:58:21.687 回答