To put it simply:
MongoDB is a document-oriented database system. It is written in C ++ and does not support SQL
Use bson as the data storage and transmission format. Bson is a JSON-like binary serialization document that supports nested objects and arrays.
MongoDB is similar to MySQL. document corresponds to MySQL row and collection corresponds to MySQL table.
1. Start the server first
Mongod.exe -- dbpath K;/date (the specified directory must be created first, so no error is reported)
2. Start the client
Cmd.exe
(There is a default database test in the database)
Show DBS show all databases
DB. user creates a table
DB. User. Save ({name: "lei", sex: "boy"}) adding a user to a user is equivalent to "insert ".
DB. User. Find () to view all data in the table
3. Create a new database
Use student (if student does not exist, create the student library ).. If no data is inserted, the database name is not displayed.
(Well, The MongoDB query statement will not be written ).. Go home and check the comparison between the query statement and MySQL...
4. MongoDB security and authentication (permission)
In MongoDB, we can specify permissions for specific sets or documents (of course, it seems useless to have an administrator admin set and document permissions)
1. Create a user dB. Student. adduser ("1", "1 ")
2. Specify a permission user dB. Student. Auth ("1", "1") for this table ")
5. data import and everywhere (For MySQL databases)
1. import data from MySQL to MongoDB.
2. Export data in MongoDB
6. Make the MongoDB server a "service" of the system"