AddThis Social Bookmark Button
  1. Show all the database available in the mongo
    show databases
  2. Choose a database in the mongo shell
    use [name_of_database]
  3. Show all the collections available on the current / chosen database
    show collections
  4. Import given json into your database using mongoimport 
    mongoimport -d [database_name] -c [collection_name] < data.json
  5. Starting mongoDB on a different port number
    mongod --port
  6. Starting mongoDB to an given directory for datafiles
    mongod --dbpath e:\mynewdbpath
  7. Restoring a bson document into your db
    mongorestore --db [name_of_your_db] [path_where_bson_is_located]