????1. ???MongoDB??

????MongoDB??????Windows??Ubuntu???Mac OS X??????????????????MongoDB??zip????????????????????????- MongoDB-

????folder/bin/mongod???

????????mongod???MongoDB???

$./mongod
Tue Sep 11 21:55:36 [initandlisten] MongoDB starting :
pid=72280 port=27017 dbpath=/data/db/ 64-bit host=Yongs-MacBook-Air.local
Tue Sep 11 21:55:36 [initandlisten] db version v2.0.7?? pdfile version 4.5
Tue Sep 11 21:55:36 [initandlisten] options: {}
Tue Sep 11 21:55:36 [initandlisten] journal dir=/data/db/journal
Tue Sep 11 21:55:36 [initandlisten] recover : no journal files present?? no recovery needed
Tue Sep 11 21:55:36 [websvr] admin web console waiting for connections on port 28017
Tue Sep 11 21:55:36 [initandlisten] waiting for connections on port 27017

????2.????MongoDB??

????MongoDB??????????$ MongoDB-folder/bin/mongo

????$ ./mongo

????MongoDB shell version: 2.0.7

????connecting to: test

????3.?????????????????

??????MongoDB?У??????????????????????????????????????????????????л???????????????????д???????

????In below example?? after you inserted a single record?? database “mkyong”?? and table “users” are created on the fly.

????????????????У??????????????????“mkyong”??????“???”??????????

$ ./mongo
MongoDB shell version: 2.0.7
connecting to: test
> use mkyong
switched to db mkyong
?
> db.users.insert({username:"mkyong"??password:"123456"})
> db.users.find()
{ "_id" : ObjectId("504f45cd17f6c778042c3c07")?? "username" : "mkyong"?? "password" : "123456" }