MongoDB introduction and installation, MongoDB introduction and Installation

Source: Internet
Author: User
Tags mongodb server

MongoDB introduction and installation, MongoDB introduction and Installation

Mongo DB is a non-relational database (NoSql) that is very popular in the IT industry, and is favored by IT practitioners with flexible data storage methods. Now, we will briefly introduce the installation of Mongo DB and Mongo DB, as well as the differences with relational databases.


Brief Introduction:

Mongo DB data is stored in a data set by group, which is called Collenction ). Each set has a unique identification name in the database and can contain an infinite number of documents. The concept of a set is similar to that of a table in a relational database. The difference is that it does not need to define any schema.

MongoDB uses the data structure BSON (Binary JSON) to store data and exchange network data. BSON not only supports more complex data types, but also has schema-free (Mode-free) therefore, we can store Document objects of different structures in a database without defining any structure.

The Document object exists as a key-value pair. The key uniquely identifies a document, a string type, and a value can be a complex file type, such as a sentence, an image, an array, and a collection.

During the operation, Mongo DB does not need to manually write SQL statements and uses Shell commands for CRUD. The operation Syntax of Shell commands is similar to that of JavaScript, it can be said that the underlying query statements on the console are executed using JavaScript scripts.

The MongoDB server can run on Linux, Windows, and other platforms. It supports 32-bit and 64-bit applications. The default port is 27017.


MongoDB installation:
1. I used mongodb-win32-x86_64-2008plus-2.6.6.zip, decompress it, create file path: E: \ Program files \ mongodb-2.6.6, copy the decompressed file to the folder. 2) create a data folder under the mongodb folder, path: E: \ Program files \ mongodb \ data 3) create two folders in the data folder: db, log, path: E: \ Program files \ mongodb \ data \ db, E: \ Program files \ mongodb \ data \ log 4.exe run cmd.exe and enter the DOS operation environment to enter the bin directory: 5) create a log file command: mongod -- logpath "E: \ Program files \ mongodb \ data \ log \ log.txt" The log.txt file is displayed under the logfolder 6) the command for creating a db file is as follows: mongod-dbpath "E: \ Program files \ mongodb \ data \ db"

After the following information is displayed, it indicates that the installation is successful. Now you can go to the shell operation. The following folders are automatically generated in the db Folder:

Run cmd.exe again, enter the DOS environment, and enter the command: cmd.exe. After the link is successful, collections: 0 will be automatically changed to collections: 1, as shown below:

In this way, you can perform Shell operations.


Differences from relational databases:


Summary:

Mongo DB implements the object-oriented idea (OO idea), and every record in Mongo DB is a Document object. All data persistence operations in Mongo DB do not require developers to manually write SQL statements. CRUD operations can be easily implemented by directly calling methods.


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.