简体   繁体   English

Mongo中的流星数据在哪里?

[英]Where is Meteor data in Mongo?

I was coding along with the Meteor simple colours example screencast . 我正在与流星简单颜色示例截屏视频一起编码。 After inserting some colours into the database via the Chrome JS Console (1:08 in the video): 通过Chrome JS控制台将一些颜色插入数据库后(视频中的1:08):

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

I wanted to see if I could find this same data in the mongo console: 我想看看是否可以在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()
>

Nothing. 没有。

Why is there no data in there? 为什么那里没有数据?

Also why is there a ")" after the "colors" collection name, is that related? 另外,为什么在“颜色”集合名称后有一个“)”,这有关系吗?

This is my .js file: 这是我的.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