The first experience of MongoDB

Source: Internet
Author: User

MongoDB is an open-source NoSQL database that is used primarily for data-heavy occasions and as a golden partner of node. JS, because it uses binary JSON format, so it has an affinity with JavaScript that no language can match. The specific introduction of this article does not elaborate, the following mainly for MongoDB under Windows to join the local services to do some simple sharing. To facilitate the first contact with MongoDB and in the Windows environment for the development of students.

First go to the official website to download the Windows installation package: Http://www.mongodb.org/downloads

In general, choose the default 64-bit (unless your host is 32-bit), after downloading, suppose we install to: D:\mongodb-win32-i386-2.4.5, after completion,

I like to re-build a folder D:\mongodb Enter the directory, create a new data and logs two folders, and create a new mongodb.log in the logs directory.

Work is ready, now it's time to start MongoDB service.

We need to create a permanent service, which requires us to add MONGO to the Windows Local Service,

Here I wrote a script to initialize the database:

1 @echo off2 CLS3 4 Color 8A5 6 Echo.7 Echo.8 echo "01.install Windows Service"9 mongod--dbpath "D:\mongodb\data"--directoryperdb--logpath "D:\mongodb\logs\mongodb.log"--logappend--install- ServiceName "MongoDB"Ten  One Echo. A Echo. - echo "02.start service" - net start MongoDB the  - Echo. - Echo. - echo "03.init success" +Pause

Of course, there are scripts to unload the database:

@echo offcolor 8aecho.echo.echo "01.stop service" net stop MongoDBecho.echo.echo "02.remove Windows Service" Mongod-- DBPath "D:\mongodb\data"--logpath "D:\mongodb\logs\mongodb.log"--remove-servicename "MongoDB" Echo.echo.echo "03. Stop Success "Pause

Run the Build database initialization. Bat after display:

Indicates that the MONGODB service has been installed on Windows;

Open the Services window to see:

The first experience of MongoDB

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.