MongoDB is a very popular NoSQL database management system, officially: MongoDB,
I installed in localhost is the Enterprise Server version, the default installation file directory is: C:\Program files\mongodb\server\3.2\bin, click Windows+r, enter cmd, start command Prompt, go to the installation directory
Every time you open command prompt you need to enter the installation directory of MongoDB is very troublesome, you can modify the computer environment Variables, right click this pc->properties, click Advanced System Setting->environment Variables, open the Environment Variables form, modify the path system variable, append "C:\Program files\" to the string of the path variable Mongodb\server\3.2\bin ", note between two paths with"; " Segmentation.
1. Enable the database server
Mongod start the database server and listen for 27017 port.
Mongod
2, link to database on database server
MONGO start MongoDB Shell,shell will automatically connect to the MongoDB server, you must ensure that Mongod is started.
The MONGO command has a parameter that is used to remotely connect to the database on the specified server.
MONGO Server-name/db-name
3. View the current connected DB
Use the DB command to view the database being connected
Db
4. View the DB and collection in the server
Show Dbsshow Collections
5, Switch DB
Use Foo
6, help command
Help
DB.HELP () Viewing database-level Help
Db.foo.help () Viewing collection-level help
MongoDB Shell Common Commands