我创建了&使用Meteor
部署了一个应用程序。部署名称myapp.meteor.com。访问来自MongoDB的Meteor Collections问题?
命令提示符从流星:
Meteor mongo myapp.meteor.com
//Below one is Response from Meteor mongo myapp.meteor.com command
MongoDB shell version: 2.4.8
connecting to: production-db-b3.meteor.io:27017/myapp_meteor_com
命令提示符从MongoDB的:
use myapp_meteor_com
我一直在使用的myapp code.From创建的Emp收集我曾尝试使用以下程序连接到Mongo DB
Mongo DB命令提示符我将尝试从myapp中看到创建的集合但它不显示。并且我正在使用以下过程显示集合:
connecting to: test
> show dbs
myapp_meteor_com (empty)
local 0.078125GB
> use myapp_meteor_com
switched to db myapp_meteor_com
> show collections //here shows nothing but js file contains `Emp Collection` and data inserted as shown below.
> //here no collections shows.
所以我没有任何想法显示,请建议我为上述问题做什么?
//将这里的数据插入Emp集合obj。 JS代码:
if (Meteor.isServer)
{
Meteor.startup(function()
{;
if (Emp.find().count() === 0)
{
for (var i = 0; i < 10; i++)
Emp.insert({ fname: "xxx",userid: i, email : "[email protected]"});
}
});
}
有时集合实际上是在您为其写入内容时创建的。 – imslavko