0

I have deployed my meteor application on localhost for demo purpose by following what was mentioned here.

$export MONGO_URL='mongodb://localhost'
$ export PORT=3000
$ export ROOT_URL='http://example.com'
$ node main.js 

I have had a bunch of collections in my meteor's mongo instance while development and need to move it to the new db that the deployed version connects to. I've taken a mongo dump of that and I know how to restore it. My question is, how exactly do I connect to the mongo db in order to do this?

I've tried:

mongo localhost
mongo localhost:3000
mongo -U localhost

They don't seem to work.


NOTE -

I do not want to run the mongo in development environment using meteor mongo. I have to deploy this in the client machine.

Community
  • 1
  • 1
blueren
  • 2,730
  • 4
  • 30
  • 47

2 Answers2

0

You can use the Meteor command line tools to attach to your local meteor instance.

meteor mongo

Taken from https://docs.meteor.com/commandline.html#meteormongo

Also, I think your commands didn't work 'cause the meteor mongo instance is hosted on port 3001 instead of 3000. Port 3000 hosts the actual meteor app, 3001 is the mongo instance.

k.chao.0424
  • 1,191
  • 10
  • 11
  • I need to have it run off a client machine and not the dev environment. So meteor mongo isn't going to help. – blueren Jul 28 '16 at 05:22
0

As k.chao.0424 says you can use meteor mongo to connect to the mongo db via terminal or command line if you are using windows. But as i see you used the port 3000 for mongodb. I suggest you a simple way you just run the follwing command to run meteor and mongo db just write on your terminal:-

meteor

or if you are using ubuntu and any permission issues than write:-

sudo meteor

It will automatically run your project on 3000 port and your mongdb in 3001 port as by default after running app you can connect with mongodb via following command:-

meteor mongo

Hope this will help!

Parveen yadav
  • 2,252
  • 1
  • 21
  • 35