简体   繁体   English

meteor.js入门示例-没有集合输出

[英]meteor.js starting example - no collection output

I tried this official tutorial: https://www.meteor.com/tutorials/blaze/collections 我尝试了这个官方教程: https//www.meteor.com/tutorials/blaze/collections

I have installed meteor today (v1.2.1) I have not restarted but I restarted explorer.exe, so that meteor's environment variable is known, so that I can use it. 我今天已经安装了流星(v1.2.1),但尚未重新启动,但重新启动了explorer.exe,以便知道流星的环境变量,以便可以使用它。 I use Windows 10. 我使用Windows 10。

So, what I is the following: 所以,我的意思是:
1) meteor install --example simple-todos 1)流星安装--example simple-todos
2) replaced the js code with the js code from the tutorial 2)用本教程中的js代码替换js代码
3) replaced the html code with the html code from the tutorial 3)用本教程中的html代码替换html代码
4) replaced the css code with the css code from the tutorial 4)用教程中的CSS代码替换CSS代码

Now, there is - as expected - no output list. 现在,正如预期的那样,没有输出列表。 When I insert something into the database via: 当我通过以下方式将某些内容插入数据库时​​:
1) meteor mongo (same folder as above, of course) 1)流星蒙哥(当然是与上面相同的文件夹)
2) db.tasks.insert({text: "lalala"}); 2) db.tasks.insert({text: "lalala"}); with output: 输出:

WriteResult({ "nInserted" : 1 }) WriteResult({“ nInserted”:1})

3) db.tasks.find(); 3)db.tasks.find(); with output: 输出:

{ "_id" : ObjectId("56bfa0835701c8a5208bc51d"), "text" : "lalala" } {“ _id”:ObjectId(“ 56bfa0835701c8a5208bc51d”),“ text”:“ lalala”}

then I have no update in my browser. 那么我的浏览器中没有更新。 F5 does not help. F5没有帮助。

I have done several tests: 我已经做了几个测试:
1) console.log(tasks.find({}).fetch()); 1) console.log(tasks.find({}).fetch()); returns the entry in my command line 返回我的命令行中的条目
2) returning [{text: "test"}] works 2)返回[{text: "test"}]作品

I have no clue what I did wrong. 我不知道我做错了什么。 Obviously, I am a beginner. 显然,我是一个初学者。 Got someone some idea what I could try next? 让某人知道我接下来可以尝试什么?

I got it... 我知道了...

autopublish was not installed per default. 默认情况下未安装自动发布。 If I add it, it'll works. 如果添加它,它将起作用。 If I remove it, I have to add the publish/subscribe mechanism to get it to work. 如果删除它,则必须添加发布/订阅机制才能使其正常工作。

Edit: And it was not installed because I used: 编辑:并且未安装,因为我使用了:

meteor create --example simple-todos

instead of 代替

meteor create simple-todos

I confused myself here, my bad. 我在这弄糊涂,我很不好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM