客户端查询延迟 - Meteor's Mongo Collections
Delay on client side query - Meteor's Mongo Collections
我是Meteor新手,我正在客户端尝试一个简单的集合查询。我在根目录中的通用文件中声明了Subject
集合.js因此client/
和server/
文件夹中的文件都可以访问它。
问题:当我想通过drop
帮助程序在home
模板中显示一些Subject
数据时,数据会显示,然后消失。使用控制台.log在我的帮助程序定义中,我看到数据按以下顺序显示,日志记录之间有 ~20 秒的延迟。
-
[]
-
[Object]
-
[]
-
[Object]
如果我查询服务器,结果是快速和正确的。我的对象如下所示:
{"_id":"b97SpxtduH2spqLXw","id":"15920","upd":"2013-12-29 04:42:16","uuid":"be81554a-7759-11e4-adb6-57ce06b062da","term_id":"9000","lang":"en","part_speech":"","gender":"","term":"Terminologia Morphologica","source":"","description":"","wiki":"","email":""}]
我已经将我的代码剥离为我向您展示的内容。我有autopublish
包,但是当我在客户端查询时,我总是遇到这种延迟。当我在客户端内对查询进行简单console.log
时.js我得到undefined
.
[编辑2:] 流星删除乌东丹:批量收集更新完成了这项工作。谢谢。[编辑:]我尝试删除所有其他软件包,重新安装meteor,尝试其他浏览器(Chrome 39.0.2171.71(64位(,Safari 8.0(。我使用的是优胜美地OS X版本10.10.1。root/subject.html:
<template name="home">
{{#each drop}}
Smth {{this.term}}
{{/each}}
</template>
根/通用.js:
Subject = new Mongo.Collection("subject");
客户端/客户端.js:
Template.home.helpers({
drop: function () {
var c = Subject.find({uuid: "be81554a-7759-11e4-adb6-57ce06b062da", lang: "en"}).fetch();
console.log(c);
return c;
}
});
我的流星包:
Users-MBP:subject user$ meteor list
accounts-github 1.0.2 Login service for Github accounts
accounts-google 1.0.2 Login service for Google accounts
accounts-twitter 1.0.2 Login service for Twitter accounts
accounts-ui 1.1.3 Simple templates to add login widgets ...
autopublish 1.0.1 Publish the entire database to all cli...
insecure 1.0.1 Allow all database writes by default
iron:router 1.0.3 Routing specifically designed for Meteor
meteor-platform 1.2.0 Include a standard set of Meteor packa...
nooitaf:semantic-ui 1.1.2 Semantic UI packaged for Meteor
udondan:bulk-collection-update 0.2.0 Bulk insert/update/delete documents in...
你的代码对我来说也很棒。
meteor remove udondan:bulk-collection-update
删除批量收集更新包。那行得通吗?
相关文章:
- 测试mongo脚本中是否存在参数
- 在Meteor Mongo中寻找价值
- 如何使用javascript var引用Mongo DB集合's字段
- Validate JSON from Mongo?
- 如何组织用户系统的Mongo集合
- 检查对象是否是mongo游标
- Electron:Express.js服务器在Mongo数据库'It’准备好了
- 尝试过滤“;引号"基于'"类别“;使用流星&mongo
- Mongo aggregation 2
- Mongo-JS-如何将BSON/JSON对象转换为XML
- 无法将参数传递给mongo find集合
- 在不重构Mongo数据库的情况下,更新嵌入数组中的具有给定ID的对象
- Mongo操作符$pull不工作(Meteor.js)
- 让 Mongo 连接到 Express App
- 如何在 Meteor 中的 Mongo 查询中使用变量作为字段名称
- 遍历 mongo 光标以列出 Meteor Blaze 中的所有值
- 范围错误与 mongo 进行$near查找
- Mongo/Mongoose快速更新会导致数据丢失
- 以有效的方式搜索对象列表 mongo
- 客户端查询延迟 - Meteor's Mongo Collections