1. Connect to the server:
Mongo
2. Connect to the database
Use dbname
3. Querying the names of all collections
Db.getcollectionnames ()
4. Querying data for a collection
Db.collection.find ()
Db.collection.find ({columnname: "value"})//accept only one parameter
5. Inserting data in a collection
Insert a single column of data: Db.collection.insert ({columnname: "value"})
Insert a two-column data: Db.collection.insert ({columnname1: "value1", columnname2: "value2"})
Insert multiple records: for (i=1;i<100;i++) Db.collection.insert ({columnname:i})
6. Updating Data
Db.collection.update ({column1:1},{column1:999})
Db.collection.update ({column1:100},{$set: {column2:99}})//Set Column2 for record Column1 to 100 to 99
7. Delete
Delete Table: Db.collection.drop
Delete database: Db.dropdatabase ()
Delete Record: Db.collection.remove ({column:100})
[Mongo] Simple Operation command