Where is the meteor MongoDB database?

后端 未结 3 1696
半阙折子戏
半阙折子戏 2020-12-17 17:36

When I create a meteor app, where is the database?

I have an app called leaderboard, but when I run mongo shell and do show dbs I see only local (

相关标签:
3条回答
  • 2020-12-17 18:23

    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
    

    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
    >
    

    For mongoimport, you'll probably want something like:

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

    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
    
    0 讨论(0)
  • 2020-12-17 18:35

    You can connect to your app's mongodb with meteor mongo and then us show collections to list the Meteor.Collections you've created.

    0 讨论(0)
  • 2020-12-17 18:39

    For apps running a local db server, APPDIR/.meteor/local/db

    0 讨论(0)
提交回复
热议问题