Installation

  1. Copy Download link in timetohide.me and download installation package.

  2. Extract package in /opt/ path

  3. Create /data/db/ directory
  4. Start Server
sudo ./opt/mongo/bin/mongod
  1. Execute Shell
sudo ./opt/mongo/bin/mongo
  1. Show all Data Bases
show dbs
  1. Use database
use db_name
  1. Add document to collection
db.collection_name.insert({key: “value” , key2: “value2”})
  1. Get document values
db.collection_name.find({key: “value”})
  1. Show collections
show collections
  1. Get all documents of collection
db.collection_name.find()

Data Storage

With restart server, data are still stored

Reserved TCP Ports

Default Port Description
27017 The default port for mongod and mongos instances. You can change this port with port or –port.
27018 The default port when running with –shardsvr runtime operation or the shardsvr value for the clusterRolesetting in a configuration file.
27019 The default port when running with –configsvr runtime operation or the configsvr value for the clusterRolesetting in a configuration file.
28017 The default port for the web status page. The web status page is always accessible at a port number that is 1000greater than the port determined by port.

Refrences

Monogo DB web site

Share: