One, download.
XP system, 32-bit:
Https://www.mongodb.org/dl/win32/i386
Cases:
Win32/mongodb-win32-i386-2.0.7.zip
Http://downloads.mongodb.org/win32/mongodb-win32-i386-2.0.7.zip
Size about 17M.
Win32/mongodb-win32-i386-3.2.7.zip
Http://downloads.mongodb.org/win32/mongodb-win32-i386-3.2.7.zip
Size about 138M.
Internet is not good, it is recommended to download the lower version of the study. The file is very small.
Two, run.
Unpack, locate all the. exe files under the bin directory, and copy to the directory "D:\MongoDB".
In the "D:\MongoDB" directory, create a new "data" folder, which will be the root folder for data storage.
Run cmd, run D:\MongoDB\mongod--dbpath D:\MongoDB\data
In the browser input: http://localhost:27017/, you can see the following prompt:
You is trying to access MongoDB on the native driver port. For HTTP diagnostic access, add the port number
It worked.
Three, basic operation.
Open another cmd, enter the MONGO command to open the shell, in fact, this shell is the client of MongoDB, but also a JS compiler, the default connection is "test" database.
<1> Insert Operations
Well, the database has, the next step is the collection, here to take the collection named "Person", note that the document is a JSON extension (Bson) Form.
<2> Find operations
After we insert the data, it is definitely to find out, or plug in the white plug, here to pay attention to two points:
① "_id": This field is the GUID that the database gives us by default, the purpose is to guarantee the uniqueness of the data.
② strictly in accordance with the Bson form of the document, but it doesn't matter, the error is very powerful.
<3> Update operation
The first parameter of the Update method is "find condition", the second parameter is "updated value", and learning C #, I believe it is well understood.
<4> Remove operation
Remove if no parameters will delete all data, oh, very dangerous operation, in MongoDB is a non-revocable operation, think twice before the line.
Another: graphical management tools Mongovue
MongoDB Quick Learning Notes