MongoDB Introductory Tutorial Windows MongoDB Database Installation diagram _mongodb

Source: Internet
Author: User
Tags mongodb mongodb client

About the benefits of MongoDB, advantages and so on here is not said, the only thing to talk about is the MongoDB: Database, collection, document, where "set"

is "table" in the corresponding relational database, and "document" corresponds to "line".

One: Download

MongoDB official website, we found that there are 32bit and 64bit, this depends on your system, but here are two points to note:

①: According to industry rules, the even number is "stable edition" (such as: 1.6.x,1.8.x), the odd number is "development version" (such as: 1.7.x,1.9.x), the difference of these two versions believe everybody knows.

②:32bit MongoDB can only hold 2G of data, 64bit there is no limit.

I download the "2.0.2 version, 32bit", OK, download after I put to "e disk", changed the folder name "MongoDB".

Two: Start

①: Before we start, we need to assign a folder to MongoDB, named "DB", to hold the MongoDB data.

②: Microsoft logo +r, input cmd, first find the "MongoDB" path, and then run the Mongod to open the command, with the--dbpath to specify the data storage location for the "DB" folder.

③: Finally to see if the success of the open, from the information in the figure, MongoDB using 27017 ports, then we will type in the browser "http://localhost:27017/",

After opening, MongoDB tells us that on 27017 add 1000 can view MongoDB Management information in HTTP mode.

Three: basic operation

Because it is the opening, it is probably the next basic "additions and deletions", we open a cmd, input MONGO command open shell, in fact, this shell is MongoDB client,

Also is a JS compiler, the default connection is the "test" database.

<1> insert Operation

Well, the database has, the next step is the collection, where the collection named "Person", to note that the document is a JSON extension (Bson) Form.

<2> Find operation

We will be inserted into the data, it is definitely to find out, or inserted into the white plug, here to pay attention to two points:

① "_id": This field is the GUID that the database adds to us by default, the purpose is to guarantee the uniqueness of the data.

② strictly in the form of Bson writing documents, but it does not matter, the wrong hint is still very powerful.

<3> Update operations

The first parameter of the Update method is "criteria to find", and the second parameter is "updated value", and I believe it is very well understood by learning C #.

<4> Remove operation

Remove all data without parameters, oh, very dangerous operation, in the MongoDB is an irrevocable operation, think twice before you do.

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: 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.