MongoDB can be run as a network server, and clients can connect to the server and perform operations.
1. First, the user must download MongoDB and unzip, run the Mongod command to launch the instance
: Http://www.mongodb.org/downloads
Configure environment variables to facilitate shell command operations later
2. Launch an instance
Then we can start the DB instance through the Mongod command, the simplest way to start is:
Mongod–dbpath E://database/mongodb
After the command is executed, if the target folder is before the database object, it is automatically created and started, and if the directory already exists the database is started
PS:--auth indicates a secure boot, the user must log in to a valid account in order to be able to ask the database, the relevant security configuration subsequent to the
3. Working with the database through the shell
Run MONGO to start the shell
Execution MONGO equivalent to MONGO 127.0.0.1:27017
After successful execution, we can get the current shell version number and link to the test library by default
Execute db to view the current point to the database
Ps:admin System Internal Database
Basic operation of 4.shell
MongoDB comes with a JavaScript shell, and we can interact with the database through the shell using the command-line approach. Because the shell is a JavaScript parser, you can run arbitrary JavaScript code
1) Create a document insert
2) Read the document find
3) Updating the document update
MongoDB First Knowledge 1: Start MongoDB