MongoDB Quick Learning Notes

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.