Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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):

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

I wanted to see if I could find this same data in the mongo console:

$ 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:

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

if (Meteor.isClient) {
  Template.colour_list.colors = function()
  {
    return Colors.find({}, {sort : {likes: -1, name: 1}});
  };
}
like image 288
nickponline Avatar asked Dec 07 '12 19:12

nickponline


Video Answer


1 Answers

Yes, remove your ) and try again ...

Colors = new Meteor.Collection("colors");
like image 179
solisoft Avatar answered Sep 26 '22 16:09

solisoft