【发布时间】:2015-09-30 08:04:51
【问题描述】:
嗨,我开始使用流星,所以我有一个问题:我无法从客户端文件夹访问集合
我的项目结构是默认的:meteor create testApp
/testApp
--.Meteor/
--testApp.html
--testApp.css
--testApp.js
然后我创建一个 mongo 集合并将其添加到 testApp.js
city = new Mongo.Collection('data');
使用meteor 命令运行应用程序,然后我访问 chrome 控制台
city.find().fetch();它工作完美,它返回城市
但是当我将 testApp.js 、 testApp.css 、 testApp.html 移动到名为 /client 的新文件夹中时
/testApp
--.Meteor/
--client/
----testApp.html
----testApp.css
----testApp.js
我无法从 chrome 控制台获取集合,这意味着 city.find().fetch(); 返回 []
有什么想法吗?
【问题讨论】: