Commands to install mongodb
1 min readSep 1, 2020
- sudo apt update
- sudo apt install -y mongodb
- to check status — sudo systemctl status mongodb
- To stop/start/restart db — sudo systemctl <stop/start/restart > mongodb
- To restore db — mongorestore — db <db_name> <path_to_extracted_database>
How to see collections(table) or data using console
1. In ubuntu terminal open> type : mongo
2. show all database type : show dbs
3. use any database type : use <db_name>
4. show all collection type : show collections