MongoDB Learning Note 01--Overview, installation, running

Source: Internet
Author: User

MongoDB Overview

MongoDB is a document-type NoSQL database that stores bson–> JSON binaries. The internal execution engine is the JS interpreter, which stores the document as a Bson structure and translates it into a JS object when queried. And can be manipulated by JS syntax.

MongoDB vs. traditional database

A traditional database is a structured database with the same number of columns

Document database in document units
Like what:

{    id:1,    name: "billvsme",    age:21,}
{    id:2,    name: "zhangshan",    phone:12313,    address:23424,}

Can exist under a table

The most important feature of a document database is "no structure", and each document under the table can have its own unique properties and values

Columns such as: Comment reply, scoring, at least a number of tables in the traditional database, association complex, and in the document database in a document can be completed

{    title:‘xxxx‘    comment:[        {            connent:‘你写的不错哦!!!‘,            reply:[‘评论不错‘,‘写的不错‘]        },        {            connent:‘写的不怎么样~~‘,            reply:[‘赞同‘,‘非常赞同‘]        }    ]}
MongoDB Installation

Download directly, unzip to run
Https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.4.tgz

MongoDB Run MONGODB file structure
    • Bsondump binary Export
    • MONGO client (equivalent to MySQL)
    • Mongod Service side (equivalent to mysqld)
    • Mongodump Overall Database Export
    • Mongoexport export easy to identify JSON documents or CSV documents
    • Mongorestore Importing databases
    • MONGOs Router (for shard time)
Start Mongod
mongod --dbpath /path/to/database --logpath  /path/to/logfile --fork  --port 27017
    • –dbpath Database Storage Path
    • –logpath log file path
    • –port Port Default 27017
    • –fork Background Run
Test

Direct input./mongo to enter MONGO

    • Show DBS View Database
    • Use database to enter databases
    • Show Tables/collections View Table
    • Db.help () Help

MongoDB Learning Note 01--Overview, installation, running

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.