簡體   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