Introduction to NoSQL (vii)

Source: Internet
Author: User

Introduction to NoSQL (vii)

MongoDB Introduction

    • Official website www.mongodb.com
    • C + +, based on distributed, belongs to a NoSQL
    • In NoSQL, it's the most like relational database.
    • MongoDB stores data as a document, and data structures are composed of key-value (key=>value) pairs. A MongoDB document is similar to a JSON object. Field values can contain other documents, arrays, and document arrays.
    • Because it's distributed, it's easy to scale

Comparison of MongoDB and relational databases

SQL Terminology Concepts MongoDB Terminology Concepts Explanatory notes
Database Database Database
Table Collection Database Tables/Collections
Row Document Data record lines/documents
Column Filed Data fields/Fields
Index Index Index
Table joins Table Connection MongoDB does not support
Primary key Primary key Primary key MongoDB automatically sets the _id field as the primary key

MongoDB Installation

Official Installation Documentation https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

vim /etc/yum.repos.d/mongodb-org-3.6.repo[mongodb-org-3.6]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
yum list | grep mongodbyum install -y mongodb-org

MongoDB Connection

systemctl start mongod.servicenetstat -tlnp|grep mongodtcp        0      0 192.168.221.10:27017    0.0.0.0:*               LISTEN      1999/mongod         tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      1999/mongodmongo --port 27017 --host 192.168.221.10mongo -uusername -ppasswd --authenticationDatabase db

Introduction to NoSQL (vii)

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.