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?
Asked
Active
Viewed 8,160 times
2 Answers
9
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

suspiciousfish
- 128
- 4