MongoDB a database based on Distributed file storage (a database between a relational database and a non-relational database)

Source: Internet
Author: User

1:mongodb's official website:https://www.mongodb.com

MongoDB's Chinese community:http://www.mongoing.com/ (Foreigners also value the Chinese market well, know that everyone English is not good, do the Chinese community)

MongoDB's Chinese website: http://docs.mongoing.com/manual-zh/

MongoDB's GitHub: Https://github.com/mongodb

2: Download the archive on the MongoDB GitHub upload to VMware's Linux operating system: The operation process is not long described (using Xsheel link Linux operating system, using FileZilla to upload files to the Linux operating system), Previous blogs have talked about the operation process:

Http://www.cnblogs.com/biehongli/p/7026809.html

3: Download process (simple description, according to the need to download different versions of different operating systems, the main Linux operating system ):

4: After the MongoDB compressed package to the Linux operating system can be decompressed operation (copy to the specified directory of the practice):

Several commands that MongoDB uses frequently:

Simple use of 5:mongodb (first configure MongoDB, add MongoDB path to environment variable):

After executing the VIM ~/.BASHRC command, add the following MongoDB configuration to the bottom:

After configuration, use source ~/.BASHRC to make the configuration effective, and then use mongod-version to check whether the configuration was successful:

6: Start the MongoDB database, first create the MongoDB data directory, and next create the MongoDB log directory:

Start the MANGODB database command: Mongod--dbpath data--logpath log/mongod.log-logappend--fork

parameter Description: the path of the directory file of the--dbpath database;

--logpath: The path of the database log, note that here is the path of the log file, not the path of the log directory;

-logappend: Append to the log file in append form;

--fork: Put the database files in the background to run;

Exit the MongoDB database command exit:

Script Startup and configuration file startup (no more manual startup later):

7: A brief introduction to the process of installing the MongoDB database using the Window System:

The installation process is no longer described, very simple. Baidu experience also a lot of tutorials: After installation, remember to configure the environment variables, as follows:

Verify that the configuration is successful after you configure the environment variable:

First switch to your own installation directory, then create the data directory, and then create log directory logs:

To open the MongoDB database service:

Open a new terminal (CMD), then MONGO:

For the convenience of startup, you can add MongoDB's boot to the window's service:

Command (remember to act as an administrator, you are not successful the original is probably not using an administrator to open the command line OH ~ ~ ~):

To add a service command:

Mongod--dbpath "E:\Download\MongoDB\MongoDB\data"--logpath "E:\Download\MongoDB\MongoDB\log\mongod.log"-- Logappend--install--servicename MongoDB Delete Service command: Mongod--dbpath "E:\Download\MongoDB\MongoDB\data"--logpath "e:\ Download\mongodb\mongodb\log\mongod.log "--logappend--remove--servicename MongoDB

You can then manipulate the database:

Stop the MongoDB database operation (don't assume that the database service of MongoDB is stopped by shutting down the command line ha ... ):

8: After the environment is installed, you can manipulate the MongoDB database:

Show DBS order to display a list of all data:

The Execute DB command can display the current database object or collection:

Run the use command to connect to a specified database:

The syntax format for MongoDB database creation is as follows:

User database name:

The syntax format for MongoDB database deletion is as follows:DB. Dropdatabase():

The collection deletion syntax format is as follows:DB. Collection . Drop():

First create the student database, then create a collection of Col, then view the database, then view the collection, then delete the collection, and then see if the collection was deleted:

MongoDB uses the Insert () or Save () method to insert a document into the collection, and then uses the Find () method to query the result with the following syntax:

MongoDB uses the update () and Save () methods to update the documents in the collection:

The MongoDB remove () function is used to remove data from the collection:

MongoDB a database based on Distributed file storage (a database between a relational database and a non-relational database)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.