1. Very popular NoSQL database (based on Bson format, JSON extension)
2. Install, download (default port 27017)
Start Mongod--dbpath/data/db
Server-side Mongod start after the default is the listening amount of 27017 of the port, Customer service Terminal program MONGO connection server MONGO 127.0.0.1:27017--> connection success
3. Create a Database
Use dbname; (at this point, there is no real database creation, but in the preprocessing cache pool, only the actual data is added to create the data file)
4. Add a record to the corresponding database
Db. The name of the collection (equivalent to the table name in MySQL). Insert ({name: ' Ty '})
5. View all the Databases
Show DBS
6. Display all collections of documents in the corresponding database (equivalent to all tables in the MySQL database)
Show collections
7. Querying data for a specified document
Query all: DB. The name of the collection. Find () Query the first: DB. The name of the collection. FindOne ()
8 Updating document data
Db. The name of the collection. Update ({The original data)},{$set: {New Data}})
9. Delete data from a document
DB. Name in the collection. Remove ({finder})
10 deleting a collection from a database
Db. The name of the collection. Drop ()
11 Deleting a database
Db.dropdatabase ()
First knowledge of MongoDB