Summary
In the work also often use MongoDB, each encounter new operations need to check, more trouble, ready to blog in the system to learn MongoDB. First install the MONGODB environment locally, you can download a version of Windows.
Official address
Installation
I am using the default installation, which uses the MongoDB x64 version, where the installation directory is C:\Program files\mongodb\server\3.2
MongoDB defaults to storing data in the created folder data/db of the root directory of the installed disk, using the command installation discovery and cannot create the data folder, so you can create the file manually.
Win+r Open the command-line console.
Go to the MongoDB Bin directory and run the command Mongod
can be accessed via http://localhost:27017/
Look at the contents of the Data/db folder again and you will find a lot of things.
Start a cmd.exe input command MONGO
You can see the MongoDB version number from the above, and the database with the default action is test.
Test, a new collection,mongodb named user will determine whether the user collection exists and does not exist. It is important to note that a document form in collection is JSON, but in MongoDB it has an additional name Bson, which can be understood as an extension of JSON.
Insert
Find
Tip: _id is a GUID that can be understood as the primary key ID, uniquely identifying the bar data.
Find (where)
Tip: Find parameters that can receive the Bson format.
Update (WHERE,NEW)
Tip: The update operation, the first parameter is the find condition, and the second is the value to update.
Locate the data according to _ID, and then modify the user's gender to be female.
Remove (where)
Remove the user whose name is Wolfy.
Summarize
Here is a brief introduction to the installation of MongoDB on Windows, as well as some common additions and deletions to check the operation.
Getting started with [MongoDB]