Mongo DB for windows

MongoDB (from “humongous”) is a scalable, high-performance, open source, document-oriented database. Written in C++.

Installations under windows
___________________________
Download from http://www.mongodb.org/display/DOCS/Downloads(32 bit or 64 bit)
Unzip it
Create dir in c:
C:\> mkdir \data
C:\> mkdir \data\db

Run it
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\sajith.kumar>cd \
C:\>cd mongo164\bin
C:\mongo164\bin>mongod
mongod –help for help and startup options
Fri Dec 03 15:39:07 MongoDB starting : pid=5440 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 Dec 03 15:39:07 db version v1.6.4, pdfile version 4.5
Fri Dec 03 15:39:07 git version: 4f5c02f8d92ff213b71b88f5eb643b7f62b50abc
Fri Dec 03 15:39:07 sys info: windows (5, 1, 2600, 2, ‘Service Pack 3’) BOOST_LI
B_VERSION=1_35
Fri Dec 03 15:39:07 [initandlisten] waiting for connections on port 27017
Fri Dec 03 15:39:07 [websvr] web admin interface listening on port 28017

Access it from a url localhost:28017

When creating db.foo.insert( { a : 1 } ) it will creating files c:\data\db
12/03/2010  03:55 PM 67,108,864 sajith.0
12/03/2010  03:55 PM 16,777,216 sajith.ns
12/03/2010  04:06 PM 67,108,864 test.0
12/03/2010  04:06 PM 16,777,216 test.ns
12/03/2010  04:06 PM <DIR> _tmp

commands
> help
db.help()                    help on db methods
db.mycoll.help()             help on collection methods
rs.help()                    help on replica set methods
help connect                 connecting to a db help
help admin                   administrative help
help misc                    misc things to know

show dbs                     show database names
show collections             show collections in current database
show users                   show users in current database
show profile                 show most recent system.profile entries with time >= 1ms
use <db_name>                set current database
db.foo.find()                list objects in collection foo
db.foo.find( { a : 1 } )     list objects in foo where a == 1
it                           result of the last line evaluated; use to further iterate             quit the mongo shell
exit

Advertisements

Posted on July 8, 2011, in General, Uncategorized, Windows. Bookmark the permalink. Leave a comment.

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: