Introduced
MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for Web applications.
MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.
It is characterized by high performance, easy to deploy, easy to use and easy to store data
The main features are:
• For collection storage, easily store data for object types.
• Free mode.
• Support dynamic queries.
• Full index support, including internal objects.
• Support Queries.
• Supports replication and recovery.
• Use efficient binary data storage, including large objects such as video.
• Automatically process fragmentation to support scalability at the cloud level
• Supports multiple languages such as ruby,python,java,c++,php.
• File storage format is Bson (an extension of JSON)
• Accessible via network
The so-called "set-oriented" (collenction-orented), meaning that data is grouped in a dataset, is called a collection (collenction). Each collection has a unique identifying name in the database and can contain an unlimited number of documents. The concept of a collection is similar to a table in a relational database (RDBMS), unlike it does not need to define any schema (schema).
Mode Freedom (schema-free) means that for files stored in a MongoDB database, we do not need to know any of its structure definitions. If necessary, you can store files of different structures in the same database.
The documents stored in the collection are stored in the form of key-value pairs. The key is used to uniquely identify a document as a string type, whereas a value can be a complex file type in each. We call this storage form Bson (Binary serialized dOcument Format).
The MongoDB server can run on Linux, Windows or OS X platforms, supports 32-bit and 64-bit applications, and the default port is 27017. Recommended to run on 64-bit platforms because MongoDB
The maximum file size supported when running in 32-bit mode is 2GB.
MongoDB stores the data in a file (the default path is:/data/db), which is managed using a memory-mapped file for increased efficiency.
Installation article
- Download Windows version Mongodb 3.0, officially available x32, x64. I use Windows Server R2 to do experiments.
Http://www.mongodb.org/downloads
2. Run Mongodb-win32-x86_64-2008plus-ssl-3.0.2-signed.mis, default installation path:
C:\Program Files\mongodb\server\3.0\bin
3. Open cmd to run MongoDB and find the error because the operating conditions of the MONGDB have not been configured yet.
4. New database directory C: \mongodb\data
New log directory C: \mongodb\logs
New configuration file C: \mongodb\mongo.conf
Mongo.conf: The content is as follows
# #数据文件
Dbpath=c:\mongodb\data
# #日志文件
Logpath=c:\mongodb\logs\mongo.log
# #错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file
Logappend=true
#启用日志文件, enabled by default
Journal=true
#这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
Quiet=true
#端口号 defaults to 27017
port=27017
5. Execute the mongo.conf file, wait a few minutes to create the data file to complete
(Note: The bin directory where MongoDB is installed can be added to the path of the environment variable)
6. Presence indicates a successful configuration
7. Test MongoDB running status, execute the following command, test success
8. Show all databases
9. Successfully started operation to this MongoDB
10. Make MongoDB a Windows service and recommend the second
First way: C:\USERS\DANNY>SC create MongoDB binpath= "C:\Program files\mongodb\server\3.0\bin\mongod.exe--service-- config= C:\Program files\mongodb\mongo.conf "
The second way :mongod--config C:\mongodb\mongo.conf--install
MongoDB Installation Chapter-win7 X64