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

查看:134
本文介绍了访问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要访问db?

How would I use this URI to access the db?

推荐答案

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

对于文档,您可以运行 meteor help mongo 。从运行上述help命令中提取:

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


指定--url(-U)将返回一个URL
适合于外部程序连接到数据库。对于部署的应用程序上的远程
数据库,该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 选项运行命令提供的是通过一些外部应用程序连接到数据库,即 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.

UPDATE:

当您连接到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 取自上面问候留言中的网址)。

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

要查看您的收藏请参阅在Meteor应用程序中创建的集合):显示集合。您应该得到这样的:

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天全站免登陆