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