要查看 blah.meteor.com
的(生产)数据库中的内容,我想我们应该这样做:
meteor mongo --url http://blah.meteor.com/
但是我得到了一个 URI:
mongodb://client:984dae4c-04fb-c8bb-68f6-ed83602435cc@skybreak.member1.mongolayer.com:27017/blah_meteor_com
我将如何使用这个 URI 来访问数据库?
最佳答案
你应该使用 meteor mongo http://blah.meteor.com
;甚至更短的 meteor mongo blah.meteor.com
。
对于文档,您可以运行 meteor help mongo
。从运行上面的帮助命令中提取:
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
以外的应用程序>.
更新:
当你连接到 MongoDB 时,你应该会收到类似这样的问候消息:
MongoDB shell version: 2.0.2
connecting to: skybreak.member1.mongolayer.com:27017/userdb_meteor_com
输入以下命令:use userdb_meteor_com
(其中 userdb_meteor_com 取自上述问候消息中的 URL)。
要查看您的收藏(通常是指在您的 Meteor 应用中创建的收藏):show collections
。你应该得到这样的东西:
system.indexes
system.users
users
现在您可以运行常用命令,例如:db.users.find({});
。
关于mongodb - 访问 Meteor 生产数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11801278/