1. List all databases>show DBS
2. Using the database>use Memo
3. List the collections of the current database>show Collections
4. Displaying data currently in Operation>db
5. List Users>show Users
6. New Database and data collection>db>show DBS If you are new, use a new database name. If it is a modification, find a database >use test2>db.createcollection ("T_test") in the result set of show DBS; >show DBS View Results
7. Inserting Data
Method 1:>t={name: "Thisisname", IP: "192.168.2.2"};>db.t_test.save (t); >db.t_test.find ();
Method 2:>db.t_test.insert ({name: "ThisIsName2", IP: "192.168.2.3"}); >db.t_tset.find ();
8. Finding DataFind specified field data: >db.t_test.find ({name: "ThisIsName2"});
9. Updating Data>db.t_test.update ({name: "User3"},{$set: {IP: "192.168.2.4"}}); >db.t_test.find ();
10. Delete DataDelete Row data >db.t_test.remove ({name: "This is Name"}); >db.t_test.find ();
11. Delete a table>show collections you can see the table in this database >db.t_test.drop (); Delete succeeds returns true
12. Deleting a database>db.dropdatabase (); >show DBS
Some basic operations of MongoDB