MongoDB download installation and simple additions and deletions to search

Source: Internet
Author: User
Tags mongodb download mongodb server

installation and configuration, start and stop of MongoDB under Windows

: The official download URL for MongoDB is: https://www.mongodb.org/downloads

Installation Steps 1,

Click Download Mongodb-win32-x86_64-2008plus-ssl-3.0.4-signed.msi, Next, next over.

Installation Steps 2,

I am here the default installation path, copy path: C:\Program files\mongodb\server\3.0\bin

Open the cmd window and enter the following command

1.> CD C:\Program Files\mongodb\server\3.0\bin

2.> mongod.exe--install--logpath "C:\Program files\mongodb\log\log.txt"--dbpath "C:\Program files\mongodb\data\ db

3.> net start MongoDB

Note:3.net start MongoDB for start MongoDB service, net end MongoDB stop MongoDB service.

Installation Steps 3,

This actually installs successfully, also starts the MongoDB service, enters the shell environment interface.

Immediately after, we strike the light, enter the simple MongoDB additions and deletions to change the stage

MongoDB preheating, simple to delete and change

First, let me introduce a little bit of MongoDB's basic concept.

1. MongoDB is a document-oriented database in NoSQL, which is a database product between relational database and non-database.

2, MongoDB document, equivalent to a row of data in a relational database.

3. Multiple Documents form a collection (collection), which is equivalent to a table in a relational database

4, multiple collections, grouped together, is a database

5. A running MongoDB server supports multiple databases.

inserting insert in MongoDB

First open cmd, enter MONGO to enter the shell interface

Enter show DBS to view the current database as Local. Then create the database, the library name is Fristdb, and enter use Fristdb, which is equivalent to creating the database.

Note

> Db.people.insert ({"Name": "Zhang Long Hao", "Age", 18}) This sentence cannot be inserted into the database table (collection) people because the contents of {} are not data in the JSON structure.

> Db.people.insert ({"Name": "Zhang Long Hao", "Age": 18}) so that the document format is not error, inserted successfully, meaning is inserted in the FRISTDB Library People Collection (table), the document (row data) {"name": "Zhang Long Hao" , "Age": 18}

> Db.room.insert ({"CMP": +, "tree": 20}) This sentence creates a collection (table) Insert document (row data) {"CMP": "Tree": 20}

View Select---Find in MongoDB

Note: First I inserted 2 data in the Peple collection, one is 18 years old, one is 20 years old.

> Db.peple.find () Isolate all the documents in the Peple collection

> Db.peple.find ({"Age": 18}) to isolate a document aged 18 in the Peple collection.

Modify update in MongoDB

Note: This view, I will not wordy, update ({},{}), the previous one is the query criteria, followed by the modified data document

Delete Delete--remove in MongoDB

Note: After deletion, there is a piece of data for long Hao 20.

MongoDB download installation and simple additions and deletions to search

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.