MongoDB five-minute Tutorial: getting started with MongoDB Shell

Source: Internet
Author: User
Tags add numbers mongodb server

In this five-minute tutorial, we will teach you how to quickly get started with MongoDB in a Windows environment. This article describes how to connect to the MongoDB server and how to use the MongoDB shell.

First, you need to download the 64-bit Windows 64-bit MongoDB program file, decompress the downloaded ZIP file to any location selected, decompress the file, and rename the folder to "MongoDB ".

Step 2: Open the folder of the decompressed and downloaded MongoDB program file and you will see the following executable file:


▲Mongodb executable files

Among them, two exefiles are the most important, one is mongod.exe that connects to the local data warehouse server, and the other is mongod.exe that starts MongoDB shell.

By default, MongoDB stores the new database and Data in the Data folder of drive C. The Data folder needs to be created manually by using the following methods:


▲Manually create a Data folder

You can connect to the MongoDB server by executing the mongod.exe file, as shown in:


▲Execute the mongod.exe file to connect to the MongoDB Server

After the MongoDB server is started, you can run the following mongo command to start the MongoDB shell.


▲Start MongoDB shell

To add two numbers in MongoDB shell, perform the following operations:


▲Add numbers in MongoDB shell

By default, it will connect to the database for testing:

To insert data, run the following command to create a database named "debugmode" and insert a document named dj:

You can view the help options to learn more about executable files and commands. In subsequent articles, we will further introduce how to use MongoDB and CSharp together.

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.