Installing and Setting MongoDB

  1. Download vers 1.6 from http://www.mongodb.org/downloads
    • bin/mongod – MongoDB server
    • bin/mongo – MongoDB client
    • bin/mongodump – MongoDB dump tool – for backups, snapshots, etc..
    • bin/mongorestore – MongoDB restore a dump
    • bin/mongoexport – Export a single collection to test (json,csv)
    • bin/mongoimportjson – Import a json file into a collection
    • bin/mongofiles – Utility for putting and getting files from MongoDB gridfs
  2. Run mongod
    1. D:\apps\mongodb\bin>mongod
      mongod –help for help and startup options
      Fri Aug 13 11:21:23 MongoDB starting : pid=3452 port=27017 dbpath=/data/db/ 32-bit** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data

      ** see http://blog.mongodb.org/post/137788967/32-bit-limitations

      Fri Aug 13 11:21:23 db version v1.6.0, pdfile version 4.5
      Fri Aug 13 11:21:23 git version: 2c7f164b653f0d703947572ede064aed41cc2185
      Fri Aug 13 11:21:23 sys info: windows (5, 1, 2600, 2, ‘Service Pack 3′) BOOST_LIB_VERSION=1_35
      Fri Aug 13 11:21:23 exception in initAndListen std::exception: dbpath (/data/db/) does not exist, terminating
      Fri Aug 13 11:21:23 dbexit:

  3. Mongo Daemon exits with failure as it expects a folder for storing database. Create data folder and rerun
  4. mkdir /data/db
  5. run mongod
D:\apps\mongodb\bin>mongod
mongod –help for help and startup options
Fri Aug 13 11:25:30 MongoDB starting : pid=228 port=27017 dbpath=/data/db/ 32-bit** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations

Fri Aug 13 11:25:30 db version v1.6.0, pdfile version 4.5
Fri Aug 13 11:25:30 git version: 2c7f164b653f0d703947572ede064aed41cc2185
Fri Aug 13 11:25:30 sys info: windows (5, 1, 2600, 2, ‘Service Pack 3′) BOOST_LIB_VERSION=1_35
Fri Aug 13 11:25:30 [initandlisten] waiting for connections on port 27017
Fri Aug 13 11:25:30 [websvr] web admin interface listening on port 28017

MongoDB – Installation and First Steps

MongoDb Interactive shell – basic commands

MongoDb Interactive shell – searching records

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.