1. MongoDB Installation: install MongoDB under Linux
2, for MongoDB's own understanding:
Object-oriented, highly extensible, such as a multi-field, or save a field, storing content as a bjon string.
Manually Start MongoDB
1. Create a new MONGO folder
2. Create a new Mongodb.bat in the MONGO folder
3, enter in Mongodb.bat: Mongod--dppath. /mongo.exe (exe path)
Create a usage database: Use [databaseName] is stored in the cache, and when you do not leave it will be deleted
View all databases: Show DBS
See which documents (tables) < collections > Show colections
View all documents in the database: Show collections
View data for the specified document: DB. [Documentname].find ()
View the first data: db. [Documentname].findone ()
Insert data: DB. [documentname].insert[{...}]
BULK INSERT: Shell for loop insert
The save is different from the insert operation: when _ID is the same, insert is an error, and save is saved < updated >
Update document data: DB. [Documentname].update ({query condition},{update content})
Db. [Documentname].update ({finder},{modifier})
Insertorupdate:db. [Documentname].update ({finder},{modifier},true) performs insert when not found
Batch update: DB. [Documentname].update ({finder},{modifier},false,true) does not perform insertorupdate and performs bulk update
Delete the data in the document: DB. [Documentname].remove ({...}) Example: Db.persons.remove ({name: "Ucat"}) (the collection itself and the index are not deleted)
View index: System.indexes.find ()
Delete table: DB. [Document].drop ()
Delete database: Db.dropdatabase ()
Naming specification: Must not contain: spaces 、,、....
Cannot have the same name as the system library: Admin,local,config
Db-test legal, but not through DB. [DocumentName] obtained, changed to Db.getcollection[documentname]
MongoDB's shell built-in JavaScript engine can execute JS code directly
Mongovue (MongoDB database connection tool)
Find detailed
Db. [Documentname].find ({condition},{key specified})