MongoDB 8 · Connecting and navigating
Connect to a local server
Open the shell against a database on the default port.
mongosh "mongodb://localhost:27017/mydb"
Official MongoDB 8 documentation
More connecting and navigating commands
- Check the shell version
- Connect to Atlas
- List databases
- Switch database
- List collections
- Check the server version
All connecting and navigating commands · MongoDB 8 cheatsheet