MongoDB 8 · Connecting and navigating
Switch database
Switch to a database. It is created when you first store data.
use mydb
Official MongoDB 8 documentation
More connecting and navigating commands
- Check the shell version
- Connect to a local server
- Connect to Atlas
- List databases
- List collections
- Check the server version
All connecting and navigating commands · MongoDB 8 cheatsheet