我在Meteor中很新,所以我正在关注Discove Meteor Book。但我发现了一些麻烦。当它说:在两个新窗口中打开浏览器控制台(第4章 - 集合):
Posts = new Mongo.Collection('posts')
; lib文件夹下的(filename:posts.js)(应该在双方都有效(客户端和服务器)。关于为什么是未定义的任何想法?
答案 0 :(得分:-1)
Just like insecure
, all new Meteor apps are created with the autopublish
package.
If you meteor remove autopublish
you need to publish your collections content and subscribe to it. If you haven't done so, you won't see any records since the client does not pull data from the server, this adds security measures to Meteor.
To solve: meteor add autopublish
then check the browser console for published records.