Mongodb learning (Set Operations + small vue)

Source: Internet
Author: User
Tags mongodb client

Mongodb learning (Set Operations + small vue)

Here, I first enter mongod--dbpath D: \ mongodbData to open the mongodb service.

Enter mongo 127.0.0.1: 27017/admin to open the client.

Next, I will perform the following operations:

1. delete a set:

Before deleting a collection, I first query all the data in the students collection.
Db. students. find () // query all data in the students set
Db. students. drop () // deletes a set, which is equivalent to deleting a table in mysql.

We can see that when I delete the set and query it again, there will be no data. Specifically, there is no feedback.

2. delete a database

Db. dropDatabase () // Delete the currently used database

After deleting a database through db. dropDatabase (), check the database in "show dbs" and find that the database has been deleted.

3. view the help command through db. help ()

If you cannot remember many commands during database operations at half past one, you can use "db. help ()" to view the help commands.

You can see that there are many such help documents when you enter db. help.
For example, you can use db. getName () to view the name of the currently used database, and use "db. getstats ()" to obtain the status of the current database.

At the same time, we can view the help documentation of the set through db. students. help.

4. Add set data using JavaScript

The mongodb client shell has a built-in JavaScript engine that can be used to execute js Code and methods. Next, I will write a method to add data to the students set, then, call this method.

We can see that when I call the "insert" method twice, I query the students set again and find that the data is indeed inserted.

MongoVue simple installation and use

First you need to go to the official website to download mongoVue: http://www.mongovue.com/downloads/
After the installation is complete, open and run the software. Note that the software is charged and can only be used for 13 days. Create a connection.

Click test to test whether the connection is successful.
Database, and students set data

Now, we will learn about the dedicated vue.

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.