"MongoDB" 2. Installation and use of visual tools

Source: Internet
Author: User
Tags robomongo mongodb gui

First of all: for the new version of the visual tools to support MongoDB, the controversy continues, everyone has the support of each person.

As a result, you installed the MongoDB 3.0.14 version before selecting Install.

Finally, make sure to use Robomongo as my first use of the MongoDB GUI.

First step: Download Rongomongo for installation. Download path: https://robomongo.org/download

The second step: Robomongo This GUI is still placed in the original MongoDB installation directory

Step three: Don't start the GUI first

Fourth Step:

Before you start, start the MongoDB service up first.

You can choose to start in the DOS interface, or you can start directly in the service "the previous chapter has MongoDB as a Windows service"

Fifth step: Create a new connection

Sixth step: Name the new connection

Seventh Step: Test the connection

After testing, we found that the connection was successful:

Eighth Step: Successful connection

Nineth Step: Create a new database

Tenth step: Execute part of the MongoDB command

1. Presentation Database

Show DBS Show all databases

2. Presentation Data Sheet

Use dbname into the dbname database, case sensitive, no this database does not matter

Show Collections displays a collection in the database, equivalent to a table

3. Create & Add

Db.users.save ({"Name": "LECAF"}) created a collection named users and added a new {"Name": "LECAF"} data

Db.users.insert ({"Name": "Ghost", "Age": 10}) Inserts a new piece of data into the Users collection, and if there is no users this collection, MongoDB automatically creates

There is a slight difference between save () and insert (): If the new data primary key already exists, insert () will not do the operation and prompt the error, while save () changes the original content to new content.

Existing data: {_id:1, ' name ': ' N1 '}, _id is the primary key

Insert ({_id:1, "name": "N2"}) will prompt for an error

Save ({_id:1, "name": "N2"}) will change the N1 to N2, with the function of update.

4. Find

Db.users.find () Find all data in the Users collection

Db.users.findOne () to find the first data in the Users collection

The rest of the MONGO command is like the above method of use!!!

"MongoDB" 2. Installation and use of visual tools

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.