After successfully starting the MongoDB service, open a command-line window to enter MONGO, you can do some operations of the database.
Enter help to see the basic Operations Command:
Show DBS: Display Database list
Show Collections: Displays a collection in the current database (similar to a table in a relational database)
Show Users: Show user
Use <db name>: Toggle/Create Current database
Db.foo.insert () Inserting a piece of data
Db.foo.find () Find out all the data
Db.foo.findOne () Find a piece of data
Db.foo.update () Update data
Db.foo.remove () Delete all data for the current table
Db.foo.drop () Delete current table, delete fast
Db.foo.batchInsert () BULK INSERT
Db.foo.upsert () If no eligible document updates are found, create a new document based on this condition and update the document, and update if the document is found
$set Specify a field value to create if the field does not exist
Db.foo.update ({},{"$set": {"name": "Lucy"}}) only update the first record found
$unset Delete key
Db.foo.update ({},{"$unset": {"name": 1}}) remove the name key and update only the first entry that found the record
$inc increase or decrease the value of an existing key, if the key does not exist, create one, increase the number type only, modify in-place
Db.foo.update ({},{"$inc": {"score": 1}}) score increased by 1
MongoDB Command (1)