Commands to install mongodb

Ganesh Prasad
1 min readSep 1, 2020
  1. sudo apt update
  2. sudo apt install -y mongodb
  3. to check status — sudo systemctl status mongodb
  4. To stop/start/restart db — sudo systemctl <stop/start/restart > mongodb
  5. 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

--

--