1.Windows installation of MongoDB
Http://www.mongodb.org/downloads download MSI, next step ...
After installation, to the installation directory of the bin directory execution Mongod start the database service, if not up, error "E:\data\db not found", create a corresponding folder, which is the folder to store the database.
Then start the MONGO database Shell client
2.mongo is a JavaScript interpreter that can run various JS commands directly, such as "x = 200,X/5";
You can also use the JS standard library, such as "Math.sin (MATH.PI/2);";
You can also customize the JS function, such as "function f (n) {return-n;} f (3);"
3.mongo view database, select Database
MONGO supports some non-JS extensions
such as db (view current database name), use DBNAME (switch database)
4.CRUD operation
A. Create:
Post = {"title": "Test", "name", "Yuhk", "Age": 18}
Db.yuhk.insert (POST)// This YUHK is not a database name?
B. Read
Db.yuhk.findOne ()
Db.yuhk.find ()
C. Update
Post.comment = ""//Add Comment field for post
Db.yuhk.update ({"title": "Test"},post)//The first parameter is a query condition, the second parameter is a modified value
After execution, add the Comment field to the original document
D. Delete
Db.yuhk.remove ({}); Delete all
Db.yuhk.remove ({"title": "Test"}); Delete by condition
MongoDB Installation and simple experiments