访问 Meteor 生产数据库 [英] Accessing Meteor production database

查看:21
本文介绍了访问 Meteor 生产数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要查看 blah.meteor.com 的(生产)数据库中的内容,我认为我们应该这样做:

To check out what's in the (production) database for blah.meteor.com I thought we would just do:

meteor mongo --url http://blah.meteor.com/

但我得到了一个 URI:

But instead I get a URI:

mongodb://client:984dae4c-04fb-c8bb-68f6-ed83602435cc@skybreak.member1.mongolayer.com:27017/blah_meteor_com

我将如何使用此 URI 访问数据库?

How would I use this URI to access the db?

推荐答案

你应该使用 meteor mongo http://blah.meteor.com;或者更短的meteor mongo blah.meteor.com.

You should use meteor mongo http://blah.meteor.com; or even shorter meteor mongo blah.meteor.com.

对于文档,您可以运行 meteor help mongo.从运行上面的帮助命令中提取:

For documentation you can run meteor help mongo. Extract from running the help command above:

指定--url (-U) 将返回一个 URL,而不是打开一个 shell适用于外部程序连接数据库.对于远程已部署应用程序上的数据库,URL 的有效期为一分钟.

Instead of opening a shell, specifying --url (-U) will return a URL suitable for an external program to connect to the database. For remote databases on deployed applications, the URL is valid for one minute.

所以它的意思是,通过运行带有 --url 选项的命令提供的 url 用于通过某些外部应用程序连接到数据库,即除了 meteor>.

So what it's saying is, the url provided by running the command with the --url option is for connecting to the database by some external application, i.e. other than meteor.

更新:

当您连接到 MongoDB 时,您应该会收到类似于以下内容的问候消息:

When you connect to MongoDB, you should get a greeting message similar to this:

MongoDB shell version: 2.0.2
connecting to: skybreak.member1.mongolayer.com:27017/userdb_meteor_com

输入以下命令:use userdb_meteor_com(其中 userdb_meteor_com 取自上述问候消息中的 URL).

Enter the following command: use userdb_meteor_com (where userdb_meteor_com is taken from the URL in the greeting message above).

要查看您的收藏(通常是指在您的 Meteor 应用中创建的收藏):show collections.你应该得到这样的东西:

To see your collections (usually they refer to collections created in your Meteor app): show collections. You should get something like this:

system.indexes
system.users
users

现在您可以运行常用命令,例如:db.users.find({});.

Now you can run usual commands, e.g.: db.users.find({});.

这篇关于访问 Meteor 生产数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆