Install
1. Create a mongodb folder
Create a new mongodb folder, and create a data folder for mongodb as a database
2. Install mongodb
Unlike installing SQL, install mongodb by executing the cmd command.
Run the cmd command
A. Find the bin in the file directory.
B. Deploy it using an engine in the binfile
Dbpath is the address of our mongodb database.
The installation is successful.
Default 27017 Port
Enter localhost: 27017 in the browser.
You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number
We can see that this statement proves that mongodb is successfully installed.
3. Set window environment variables
The path of the execution file in the extracted binfile is directly placed in the environment variable, so that we can directly access all the programs through cmd.
4. bat file
Start mongodb Service
My batch files: http://pan.baidu.com/s/1i3ql7bZ
Easy to use
1. Create a database
Use [databaseName]
This is only a database cache pool. If you leave this empty database, it will be deleted.
2. view all databases
Show dbs
3. Add a set to the specified database and add records
4. view all documents in the database
Show collections
5. Update document data
Db. person. update ({name: "clm" },{ $ set: {name: "czs "}})
6. delete a set in the database
Db. [document]. drop ()
7. delete a database
Db. dropdatabase
8. help displays all database operations
9. Database and set command specifications
10. mongoDB's shell built-in js engine can directly execute j code
Summary
The above is a rough understanding of mongodb, and you need to contact the specific instance for specific use.