How can I connect to local Meteor's mongodb - mongodb

How can I connect to the local Meteor's local mongoDB? Fyi, I want to use robomongo as the client. Where can I get the authentication details etc?

I'm using robomongo too
1) Just open robomongo,
2) Create new connection,
3)Give address localhost and port 3001
4) Click connect
Note: Meteor must be running to access the database
While you are creating new connection there is an authentication tab,there u can create username and password for db

enter command meteor mongo in the project directory while you are running the project. it will connect to a mongo shell of the project where you can see the mongo url.
example:
$ meteor mongo
MongoDB shell version: 2.4.9
connecting to: 127.0.0.1:3001/meteor

Related

How to connect mongodb with url

I am new to mongodb.
I have db url, and I want to connect to that server from my ubuntu terminal and access data on terminal.
can anyone please help me how to connect?
Assuming you have the URI and the mongo shell installed, you can connect using the following command:
mongo <uri>
For example, if you want to log in as admin with the password mypassword through example.com on the port 27017, you can do:
mongo mongodb://admin:mypassword#example.com:27017/?authSource=admin
See:
how can I connect to a remote mongo server from Mac OS terminal
If mongodb version is 5.x.x
mongosh --host ip

Connect mongo with meteor in production

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.
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.
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!

Connect mongodb server via robomongo from another PC

I am using mongodb database for my meteor app. I want to access it from another pc. I have mounted my local as a virtual drive on other PC using ssh. Now I want to connect to mongodb via robomongo. I have given the address as 192.168.1.2:4001 (ip addr of local : port on which meteor is running +1). But its giving an error 'Unable to connect to mongodb'. How to proceed?
The other way around is to start your meteor on a regular mongo server with this command :
MONGO_URL=mongodb://localhost:27017/nameOfDatabase meteor
Be sure to have a running mongo on localhost and to change the nameOfDatabase.
Now it's just a regular mongoDB server to connect. Also you might need to add login and password to that mongo url and the debug parameter after meteor if you use packages like meteor toys.
Please check mongodb's config file /etc/mongod.conf and comment out bind ip
net:
#bindIp: 127.0.0.1
port: 4001
Restart mongodb service. This will allow mongodb to bind to ip's other than localhost.

Connecting to mongolab db in the shell, but not in Robomongo

I am trying to connect to a MongoLab DB using the credentials and user I set up. I chose the AWS instance using the 500mb of storage (the free Sandbox version). It said it was 3.0.x for Mongo (showing 3.0.9 in MongoLab).
On my environment I am running MongoDB shell version: 3.2.1
Using the command:
mongo ds011111.mongolab.com:11111/mydbname -u dbname -p dbpass
in the shell, I am able to connect to the DB just fine. However, when trying to connect through Robomongo, I am not. I am using the same username, password, database name, host and port. When I run the test, it connects to the host and port just fine, but it says Authorization Fails (this should not be, as I was just authorized to connect in the shell).
What is going?
There is nothing wrong. Just RoboMongo 0.8.x does not support Mongo 3.0+. You can download 0.9 RC4.

How to connect to a remote meteor mongodb using robomongo

I am using Meteor. Which is installed on another server.
I want to access its mongodb from another [Ubuntu Machine].
Now how can I access that mongodb via robomongo or any other tool?
Any guidance or help would be appreciated.
In Robomongo in the upper left:
Click create
In the pop-up window enter the address and port of your Mongo server
Give the connection a name and click save.
Using the Terminal (on the client):
mongo --host <hostname> --port <port>
You have to make sure the port is not blocked on the Ubuntu machine running the Meteor application. Note: when developing a Meteor app the default Mongo port is 3001.