且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

流星MongoDB数据库在哪里?

更新时间:2022-04-08 03:22:04

您需要在一个会话中使用meteor run命令运行应用程序,此时,您可以在同一台计算机上的另一个会话中运行mongo meteor.将包含类似

You need to be running the application with the meteor run command in one session, at which point you can run mongo meteor in another session on the same machine, which will include something like

[kfullert@shotgun ]$ meteor mongo
MongoDB shell version: 2.2.1
connecting to: 127.0.0.1:3002/meteor

那时候,您可以将"connecting to"行中的URL与标准mongo工具一起使用(caveat-您需要同时使用流星运行您的项目,因为"meteor run"是旋转的您项目的mongo服务器

At that point, you can use the URL in the "connecting to" line with the standard mongo tools (caveat - you need to be running your project with meteor at the same time, as "meteor run" is what spins up the mongo server for your project

[kfullert@shotgun ]$ mongo 127.0.0.1:3002/meteor
MongoDB shell version: 2.2.3
connecting to: 127.0.0.1:3002/meteor
>

对于mongoimport,您可能想要类似的东西:

For mongoimport, you'll probably want something like:

[kfullert@shotgun ]$ mongoimport -h 127.0.0.1 --port 3002 -d meteor

另外,通过使用项目根目录中的以下开关,可以不运行流星而运行mongoimport(请注意,请注意)

Additionally, it may be possible to run mongoimport without meteor running, by using the following switch from your project root directory (untested so beware)

mongoimport --dbpath .meteor/local/db -d meteor