Diskdrive
Diskdrive

Reputation: 18825

where is the mongodb database when the meteor instance is not running

In Meteor, each new application I create, it creates a new MongoDb instance and when I run the instance by typing "meteor" it is available until I stop Meteor.

I can save data etc. into this mongodb and the next time I boot up meteor, it should appear again.

So I'm just wondering, where are these mongodbs being stored? how can I access one when I don't have the meteor server running?

Upvotes: 0

Views: 263

Answers (1)

Neil Lunn
Neil Lunn

Reputation: 151092

The actual data files are stored under the project directory under the path .meteor/local/db, so it really is just a matter of starting up an independent instance when your meteor server is not running:

 $:~/myapp$ mongod --smallfiles --dbpath .meteor/local/db --port 30000

And of course with port and/or IP binding that does not conflict with another instance, and of course without the meteor process having started a mongod instance on this data already.

But you are probably better off just defining an external server to your project and just running that separately. Just define the environment variable so the startup process knows which mongodb instance to use:

export MONGO_URL=mongodb://your_host:27017/your_db

Or otherwise essentially replacing your_host and possibly the port as well as your_db with the target details of the server and database you want to use.

Upvotes: 3

Related Questions