MongoDB Learning Summary (i) installation under--windows platform

Source: Internet
Author: User
Tags mongodb client

I. Basic CONCEPTS

MongoDB is an open source database system based on distributed file storage that provides scalable , high-performance data storage solutions for WEB applications. MongoDB stores data as a document and data structures consist of key-value key=>value . The document resembles a JSON object. Field values can contain other documents, arrays, and array of documents.

several basic concepts of MongoDB database:

1) in a MongoDB instance, there can be 0 or more database ( databases ).

2) There can be 0 or more collections (collections) in a database . is equivalent to a table ( table )in a traditional relational database.

3) A collection consists of 0 or more documents . Corresponds to row in a table in a traditional relational database .

4) The document consists of 0 or more fields. equivalent to the columns in a table in atraditional relational database.

To learn more about MongoDB conceptual knowledge, you can go to the official website to check.

Two. installing under Windows Platform

1. Download MongoDB file

MongoDB provides. msi files and. zip files available for both 32-bit and 64-bit systems , where i download the . zip file for the system .

: Http://www.mongodb.org/downloads

Here I test using a 32-bit version, it is important to note that the MongoDB database on the system is a maximum of 2GB.

Unzip the downloaded file and place it where you want it. I put it under the D:\MyProject\mongodb and Create a new folder , DB, to store the MongoDB data.

2. Start MongoDB Service

run cmd into the program directory bin , run the mongod Start command,--dbpath Specify the data to save the directory.

It is important to note that after the MongoDB service is turned on, the command-line window cannot be closed and the MongoDB service shuts down as soon as it is closed. As a result, we will typically change it to a Windows service and set it to boot automatically.

run cmd into the program Directory bin , run the following command.

Parameter description:

--LOGPATH Specifies the MongoDB log file, note that the file is not a directory.

--logappend logs are logged using the Append method.

--DBPATH Specifies the database path.

--directoryperdb creates a new directory per db.

--SERVICENAME Specifies the service name.

--SERVICEDISPLAYNAME Specifies the service display name.

--install is specified as a Windows service installation.

The following error occurred while running the above command:

The system needs to add the --journal parameter according to the error .

The service was created successfully, but could not be started, viewing the log display

Requested option conflicts with current storage engine option for DIRECTORYPERDB;

You requested true if the current server storage are already set to false and cannot be changed, terminating

2016-09-18t10:16:08.366+0800 I CONTROL [Servicestopworker] dbexit:rc:49

The hint indicates that the current server storage cannot be changed, and the--DIRECTORYPERDB parameter needs to be removed.

The service starts successfully at this time.

These are some of the errors and workarounds that I encountered when I created the Windows service.

3. Start the MongoDB client

We also open a cmd window, run the MONGO command opened the shell, theequivalent of MongoDB client .

We see that the client connection was successful.

Installation and launch under the Windows platform is here, and next we'll cover some of the basic operations commands for MongoDB.

MongoDB Learning Summary (i) installation under--windows platform

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.