Path to NoSQL learning (III): Use of MongoDBShell

Source: Internet
Author: User
You are welcome to repost this article. please keep this link! MongoDBshellMongoDB comes with a simple but powerful JavaScriptshell. When you type a variable in JavaScriptshell, the variable value is converted to a string and printed to the console. The following describes the basic operations and some precautions. Database CRUD operations will introduce NoSQL in the following sections

You are welcome to repost this article. please keep this link! MongoDB shell MongoDB comes with a simple but powerful JavaScript shell. If you type a variable in JavaScript shell, the value of the variable is converted to a string and printed to the console. The following describes the basic operations and some precautions. Database CRUD operations will introduce NoSQL in the following sections

You are welcome to reprint the address of this article. please keep this link ••!

MongoDB shell

MongoDB comes with a simple but powerful JavaScript shell. If you type a variable in JavaScript shell, the value of the variable is converted to a string and printed to the console.

The following describes the basic operations, Hong Kong servers, and some precautions. Database CRUD operations will introduce the path to NoSQL learning in the following sections (4): Creating, reading, updating, and deleting (CRUD)

Enter the Command Prompt (cmd.exe ). Go to the bin directory of the MongoDB decompressed Directory, that is, D: \ NoSQL \ mongodb-win32-x86_64-2.4.3 \ bin then execute mongo.exe (or mongo) to start MongoDB shell.

  

Shell connects to the test database by default. To use another database or website space, add a slash and database name after the server address (connect to the mongod of the local default port, but use the admin database ):

  

You can also choose to connect to the database, just like in SQL shell, and use "view current database terms.

  

Use the -- nodb option to start the shell without connecting to the database.

  

Tips: use ctrl + w to quickly delete the content of the row where the cursor is located ., Hong Kong server

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.