如何将mongodb客户端连接到本地Meteor MongoDB [英] How to connect mongodb clients to local Meteor MongoDB

查看:82
本文介绍了如何将mongodb客户端连接到本地Meteor MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Robomongo(或任何其他mongodb客户端)连接到由本地Meteor应用程序创建的mongodb实例?

How can I connect Robomongo (or any other mongodb client) to the mongodb instance that is created by my local Meteor application?

推荐答案

确保Meteor在本地主机上运行.打开一个终端窗口,然后运行meteor命令.如果您尚未更改为端口,它将开始在localhost:3000上运行.

Ensure Meteor is running on localhost. Open a terminal window and run meteor command. It will start running on localhost:3000 if you have not changed to port.

在运行时,打开一个单独的终端窗口并运行meteor mongo命令.这将打开一个MongoDB shell,并告诉您它连接到哪个端口.从0.7.1.1版本开始,通常为3001;如果是更早的版本,则为3002.它会说类似127.0.0.1:3001/meteor

While it is running, open a separate terminal window and run meteor mongo command. This will open up a MongoDB shell and tell you what port it is connecting to This is normally 3001 as of version 0.7.1.1 or 3002 if earlier. It will say something like 127.0.0.1:3001/meteor

转到Robomongo(或您最喜欢的mongodb客户端软件)并创建一个新连接,确保将连接地址更改为localhost并指定端口号.如果您的客户不坚持默认数据库,则无需另外定义/meteor.

Go to Robomongo (or your favorite mongodb client software) and create a new connection, making sure to change the connection address to localhost and the given the port number. No need to additionally define /meteor if your client does not insist on a default database.

还如 https://stackoverflow.com/a/22023284/1064151 中指出的那样可能需要特定的行尾,分隔符或其他字符流.例如, ObjCMongoDB 基于C的驱动程序希望该URL为127.0.0.1:3001/,并带有额外的/最后,否则将无法正常工作.因此,请确保您检查了驱动程序/客户端的文档.

Also as pointed out in https://stackoverflow.com/a/22023284/1064151 some drivers may need specific line endings, delimeters or other character flow. For example, ObjCMongoDB a C based driver wants the url to be 127.0.0.1:3001/ with that extra / at the end, or it won't work. So make sure you check the documentation for your driver/client.

这篇关于如何将mongodb客户端连接到本地Meteor MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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