Last Updated: February 25, 2016
·
6.216K
· suroorwijdan

Connect to remote MongoDB with your CLI

This is a very basic tip, many times you would want to connect to your QA, PROD mongo instance from your terminal.

You can do so with the following command.

mongo MONGOSERVERURL:27017

If you have authentication enabled, which you might obviously have:

mongo -u <user> -p <pass> --host <host> --port 27017

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

Account takeover often starts in the browser, on the login page itself. A malicious script can read credentials, tokens, or one-time codes as the person types them.

Security insights from Cside