About the benefits of MongoDB, advantages and so on here is not said, the only thing to talk about is the MongoDB: Database, collection, document, where "set"
is "table" in the corresponding relational database, and "document" corresponds to "line".
One, MongoDB to MySQL commonly used SQL statement corresponding realization
Copy Code code as follows:
——————————————
Mysql:
SELECT * from user
Mongo:
Db.user.find ()
——————————————
Mysql:
SELECT * FROM user WHERE name = ' Foobar
MongoDB is a powerful, flexible, scalable way to store data. It expands the many useful features of relational databases, such as secondary indexes, range queries, and sorting. MongoDB is rich in functionality, such as built-in support for MapReduce
NoSQL is very hot, mongodb as a good distributed file storage database, also received a lot of attention, Http://weibo.com/k/mongodb Sina Weibo in the daily now about more than 20 information.
Official website: http://www.mongodb.org/
Download:
Traditional relational databases are generally composed of three levels of databases (database), tables (table), records (record), and MongoDB are made up of three levels (db), Collections (collection), document objects (documents). MongoDB for
Since the blog program used by this blog is used by Edge development, some properties that are not needed are created dynamically during the development process.
MongoDB is Schema-free, unlike relational databases, where column properties are
1. Copy MongoDB to the specified server
To the MongoDB official website http://www.mongodb.org/downloads download MongoDB, unzip and test the directory to the server that needs to be installed, and then configure. For example:
Copy Code code
Today to share with you the more interesting knowledge of MongoDB, mainly include: aggregation, cursors.
One: Aggregation
Common aggregation operations are the same as SQL Server: Count,distinct,group,mapreduce.
Count
Count is the simplest,
The MongoDB itself has two integer types: 32-bit integers and 64-bit integers, but the older PHP driver, regardless of the operating system's 32-bit or 64-bit, treats all integers as 32-bit integers, resulting in 64-bit integers being truncated. In
Recently picked up Django, but Django does not support MongoDB, but there is a module mongoengine can implement the Django model similar encapsulation. But Mongoengine's Chinese documents are almost never Some is also a brief introduction and use. I'
Introduction of MongoDB
MongoDB (name from "Humongous") is an extensible, high-performance, open source, schema free, document-oriented database with the advantages of a document database, key values for storage and relational databases. Official
MongoDB is an open-source database, here do not need me to say, below the Ubuntu installation of MongoDB may encounter problems and solutions.Story background:today m$ Promotion, 1¥windows Azure 4000¥-30 Day's package, have to say is simply cabbage
First, the scene descriptionAn engineer of the company executes Db.giveget_card.drop () and mistakenly deletes the online table.Fortunately every day to do a backup, this time reflects the importance of backup, hahaha ...Second, simulate the failure
First, the objectIDthe BuildEach of the MongoDB documents requires a primary key. It must be unique for all documents in each collection. The primary key is stored in the document _id field. consists of three characters;4c291856 238d3b 19b2 0000014
1. Download the installation packagewget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgzUnzip the package after download is completeTar zxf mongodb-linux-i686-1.8.2.tgz2. Install ready to move MongoDB to the/usr/local/server/mongdb
First,MongoDB Introduction MongoDB is a high-performance, open-source, modeless document-based database that is a popular one in the current NoSql database. It can be used in many scenarios to replace the traditional relational database or key /
MongoDB Home Page http://www.mongodb.org/1, first on the internet to download a MongoDB installation package, and then open the cmd command, find the path of your mongodb files, into the MongoDB file under the Lib file, and finally executed under
mongodb is a database based on distributed file storage. Written by the C++ language. Designed to deliver scalable, high-performance data storage solutions for WEB applications. mongodb is a product between a relational database and a
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