繁体   English   中英

Mongo中的流星数据在哪里?

[英]Where is Meteor data in Mongo?

我正在与流星简单颜色示例截屏视频一起编码。 通过Chrome JS控制台将一些颜色插入数据库后(视频中的1:08):

Colors.insert({name: "red"});
Colors.insert({name: "green"});

我想看看是否可以在mongo控制台中找到相同的数据:

$ meteor mongo
MongoDB shell version: 2.2.1
connecting to: 127.0.0.1:3002/meteor
> show dbs
local   (empty)
meteor  0.0625GB
> use meteor
switched to db meteor
> show collections
colors)
system.indexes
> db.colors.find()
>

没有。

为什么那里没有数据?

另外,为什么在“颜色”集合名称后有一个“)”,这有关系吗?

这是我的.js文件:

Colors = new Meteor.Collection("colors)");

if (Meteor.isClient) {
  Template.colour_list.colors = function()
  {
    return Colors.find({}, {sort : {likes: -1, name: 1}});
  };
}

是的,删除您的),然后重试...

Colors = new Meteor.Collection("colors");

暂无
暂无

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

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