Reprint 8 days mongodb--first day Basic introduction

Source: Internet
Author: User



About the benefits of MongoDB, advantages and so on here is not said, the only thing to say is that MongoDB has ternary: Database, collection, document, where "collection"



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






One: Download



On the 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 the industry rules, even "stable version" (such as: 1.6.x,1.8.x), odd for "development version" (such as: 1.7.x,1.9.x), the difference between the two versions I believe everyone knows it.



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



I will download the "2.0.2 version, 32bit", OK, after downloading I put the "e-Disk", change the folder name "MongoDB".






Two: Start



①: Before starting, we will assign a folder to MongoDB, which is named "DB", which is used to store mongodb data.






②: Microsoft logo +r, enter CMD, first find the "MongoDB" path, and then run the Mongod Open command, while using--dbpath to specify the data storage location is "DB" folder.












③: Finally to see whether the open success, the information learned that MongoDB uses 27017 port, then we will type "http://localhost:27017/" in the browser,



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












Three: basic operation



Because it is the beginning, about the basic "additions and deletions to change", we open a cmd, enter the MONGO command to open the shell, in fact, this shell is the client of MongoDB,



Also is a JS compiler, the default connection is the "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.












————————————————————————————————————————————————————————————



————————————————————————————————————————————————————————————



Tips: If you do not like to read the article, you can step into the full version of the series MongoDB 3.0 video Tutorial "A toothpaste money Oh"



————————————————————————————————————————————————————————————



————————————————————————————————————————————————————————————


Category: MongoDB good text to the top attention to my collection of the article Line code Farm
Follow-56
Fans-6487 honors: Recommended blog + add attention the3(Would you please comment on the article)? Previous: Algorithm brainwashing series (8 articles)--the eighth chapter probability thought
? Next: 8 days learn to mongodb--the next day, adding and deleting the change
Posted @2012-02-18 00:01First-line Code farmer reading (263351Reviews the) Edit Favorites < Prev12
List of comments #51 floor2013-06-20 10:49Fei, son @ ouyang Xiao Yan
I am also depressed to die. Also appeared ...
is not MONGO very language ah ...

Recommend the landlord to post the command code.
Db. Person.insert ({"Name": "Feiazi", "Age": "22"})

That should be the case, support (1) against (1) #52 floor2013-06-20 11:36Fly, son one: Download

Two: Start

When the landlord, said the download, the direct start, I was thinking how not to install the article.

Originally... Support (3) objection (0) 53 floor 2013-08-23 15:07Ren Qingye the landlord has the relevant ebook wood have AH? Support (1) objection (0) #54floor 2013-09-25 10:06Glutinous Rice Article No. Second just saw this blog post when the blogger wrote so much, the results found that the comments are so many people, that the landlord write this series of great significance Ah, praise a support (1) against (0) #55 floor2013-10-14 19:37dj007 @ Ren Qingye
MongoDB ebook A lot of search, even this can not find still want to learn computer? Support (0) Objection (1) #56 floor 2013-11-18 14:20A reed crossing @ Ren Qingye
There must be, there is a MongoDB Quan authoritative guide support (1) against (0) #57 floor2013-12-19 15:44Thunder Clouds > Db.person.insert ({"Name": "CRH," age ": 24})
...



How long to wait ... Support (1) objection (0) #58 floor2013-12-23 10:11Boshenus @ sha Duo
> Db.person.insert ({"Name": "CRH," age ": 24})
...

The right side of CRH is missing double quotes.
The yard is very well written by brother Nong. Support Support (1) objection (0) #59 floor2014-03-15 03:09Elvinlong is to support the landlord to refuel!!! Support (0) objection (0) #60floor 2014-03-25 10:48Student family @ Flying Ah son
What's the original? I'm looking for installation support (0) objection (0) #61 floor2014-03-25 16:56Students Guangzhou PHP programmer Q Group:62484970, welcome to the prawn, rookie do not enter support (0) objection (0) #62 floor2014-05-09 13:51Flying son @ the students ' family

It's the green version. No installation is necessary. Support (0) objection (0) #63 floor2014-05-29 07:57Home.lu always feel under windows with these things, a little bit of a tune feeling. Support (1) objection (0) #64 floor2014-08-13 09:16Nickycookie, did you go to Ctrip? Support (0) objection (0) #65 floor2014-08-13 09:34Does the Nickycookie need to be installed in the Windows service? When do I need to install to Windowsservice? Support (0) objection (0) #66 floor2015-01-20 10:47No face @ Fly, son
Quote@ Brisket
referenceto the base of the good text to the top,.
Most like to see this xx days learn XXX article ...
After xx days there will be a kind of I have a sense of superiority of xxx ....


I would also like...

And I love it. Support (0) objection (0) 67th floor 2015-03-05 20:57 Learning hard to ask the landlord MongoDB reference books called What? Support (0) objection (0) 68th floor 2015-03-05 23 : 30Jello Chen @ Learning hard
I was looking at the "MongoDB Authoritative Guide" support (0) against (0) 69th floor 2015-04-23 18:18 Little Camel 123 What's this for? Support (0) Objection (1) 70th floor 2015-04-29 22 : 53Loyalty Stone is now a very popular lightweight database-non-relational! Support (0) Objection (1) 71F 2015-08-20 14: 17Crystal Agate Remove to add parameter support (1) objection (0) 72F 2015- 09-08 20:05 Have a dream of Mr. L Mark Support (0) against (1) 73th floor2015-09-22 13: 19Iceelee @ the students' family
If I am a veteran, I will not enter your group, because I like you, but also look down on the rookie. Support (0) Objection (1) 74th floor 2015-10-10 15:18 Manfredhu that Db.person.remove () doesn't seem to get used to it, my MongoDB is 3.0.6 version of Support (0) Objection (1) 75th floor 2015-11-12 15: 58aicuo1990 Remove all should be supported for Db.person.remove ( ()) (1) against (0) 76th floor 2015-11-16 22:31 Billschen Hello, two pages:
http://127.0.0.1:28017/cannot be opened.
http://127.0.0.1:27017/can open.
What is the reason? Does it affect use? Thanks a lot !!!! Support (0) objection (0) 77th floor 2015-11-17 00: 01Fcbqs @ No Face
However did not learn, embarrassed support (0) against (0) 78th floor 2015-12-17 14:35 Chenhaifeng You can teach everyone, first with mongod command, but DBPath back is not with =, this and version with the support of the relationship (0) against (0) 79th floor 2015-12-23 18:22 [email protected] Ox break, someone really bought your video support (0) objection (0) 80th floor 2015-12-25 11: 26A leaf fall to know the world autumn is good, the entry suitable. PS, the end of the advertisement makes me very annoyed. Support (0) objection (0) 81F 2015-12-31 20: 53Silence_mxy for beginners, the help is very big , like one. Support (0) objection (0) 82 floor 2016-02-01 02: 37Wkl17 Db.person.insert does the DB and E: \ mongo \ db in db correspond? Support (0) objection (0) 83 Building2016-02-25 17: 04Zhang San meow @ rain Clouds
I'm a three, too. Support (0) objection (0) 84th floor 2016-03-24 10:02 Please call me boss Brother is learning, concern. Support (0) objection (0) 85th floor 2016-04-18 10:24 Ethan Shan Mark Support (0) objection (0) 86th floor 2016-05-26 14:21 Wang Honghong Hello, I read a chapter in accordance with the requirements to download the software also runs MongoDB, but when the http: // localhost: 27017 / started error
Can you give me a hand?
Support (0) objection (0) 87th floor 2016-05-26 19:20 Menn Podcast Monogo Getting Started combat video
Http://codeorg.cn/article/share/14.html

Mongodbtest
Mongodb.ppt
Mongo-2.10.1.jar
12-Using Java operation Mongodb.avi
11-Shard. avi
10-master-slave copy. avi
09-Safety and authentication. avi
08-Backup and restore. avi
07-Fixed set. avi
06-use of the index. avi
05-Review. avi
04-mongodb Operation 3.avi
03-mongodb Operation 2.avi
02-mongodb Operation 1.avi
01-nosql Introduction. avi


Reprint 8 days mongodb--first day Basic introduction


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.