4

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?

1

2 Answers 2

11

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:[email protected]:27017/?authSource=admin

See: how can I connect to a remote mongo server from Mac OS terminal

Sign up to request clarification or add additional context in comments.

Comments

1

If mongodb version is 5.x.x mongosh --host ip

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.