MongoDB Learning (iii)

Source: Internet
Author: User

Rookie Ah ... Just spit out your own groove.

A preparatory work:

1. Install the server: Go to the official website to download http://www.mongodb.org/downloads In fact, it also comes with a client shell

2. Install the client: Mongovue http://blog.mongovue.com/is not completely free to hack: http://yhv5.com/mongovue_480.html

Download the server after the direct installation of my download on the D drive also installed on the D-Drive ...

There are no commands needed to start the service side of MongoDB .... Directly left mouse button double-click the bin in the Mongod.exe to start, and then double-click Mongo.exe, bring the shell also started, and then you can open the MongoDB trip ... What, da?

3 Test the connection: Enter the DB carriage return, OK to connect to the test database

4. Connect Mongodbvue: As shown below ...

Learning is mainly in the self-contained shell operation ...

5. Basic Crud ...

(1) Create: First build a local variable, and then insert this variable into the blog collection

    

post={"title": "MyBlog", "Content": "This is my ..."}db.blog.insert (POST);

(2) Read:

Db.blog.find ()

(3) Update:

(1) first modify the Post object   post.comment=[] (2) modify Data   db.blog.update ({title:"MyBlog"},post)

(4) Delete:

Db.blog.remove ({title: "MyBlog"})


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.