MongoDB install simple data, add, delete, change, check

Source: Internet
Author: User
Tags create directory

From where to start, start with MongoDB,

Brief introduction:

NoSQL (NoSQL = not-only SQL), probably starting in the 2009, NoSQL began to get into people's sights.

  

SQL (structured query Language) Structured Query Language

MongoDB, a member of the NoSQL camp.

 

Reasons for the foray:

What are the advantages of mongodb with respect to traditional SQL Oracle,mysql?

Sorry I don't know, I don't care, it's a matter of db care.

Nowadays, it is enough to be popular with hand-tour service, I only care about how it is applied .

Download:

Official address: http://www.mongodb.org/(the next few times did not succeed, perhaps with my thunder related, finally Baidu found a)

1. Download the software, good for your operating system, 32-bit, 64-bit in this Win7 64-bit operating system as an example, I use the RAR text.

2. Create a new directory D:\mongodb and D:\mongodb\data, locate the Bin folder under the extracted folder and copy it to the D:\mongodb

    

3.windows+r Run input cmd open cmd window

Enter: > D:
> CD D:\MongoDB\bin
> Mongod--dbpath D:\MongoDB\data

After installation is complete

In the browser input: http://localhost:27017/, you can see the following prompt:

It looks like you is trying to access MongoDB over HTTP on the native driver port.
Indicates successful installation

Create Directory D:\MongoDB\logs
Create a directory D:\mongodb\etc Create a file D:\mongodb\etc\mongodb.conf
Use Notepad to enter and save in the file mongodb.conf:

 Dbpath=d:\mongodb\data #数据库路径

Logpath=d:\mongodb\logs\mongodb.log #日志输出文件路径

Logappend=true #错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file

Journal=true #启用日志文件, enabled by default

Quiet=true #这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug

port=27017 #端口号 defaults to 27017

  CMD window input

  

The MongoDB logs can be successfully started and will be seen in the Mongodb.log

At this point, you can run the Mongo.exe under the bin to manipulate the database

>help (View related information)

>db.foo.insert ({a:1}) (Insert a,1 field value to Foo table, Foo table as default table)

>db.foo.find () (View foo table data)

The results of the operation are as follows:

  

> Db.foo.find ({a:1}) (Find Rows a=1 in table foo)

More commands See:

Http://www.cnblogs.com/xusir/archive/2012/12/24/2830957.html


  

MongoDB install simple data, add, delete, change, check

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.