In the mapreduce> of data aggregation in the previous article There are three basic aggregation functions in MongoDB: count, distinct, and group. Let's take a look at these three basic aggregate functions separately.(1) CountRole: The number of
1. Count:
Copy Code code as follows:
--In an empty collection, Count returns a number of 0.
> Db.test.count ()
0
--Test the return value of count after inserting a document.
> Db.test.insert ({"Test": 1})
> Db.test.count ()
This article introduced the MongoDB in the MapReduce implementation of data aggregation method, we mentioned MongoDB in the data aggregation operation of a way--mapreduce, but in most of the day-to-day use of the process, We do not need to use
1. Count:--In an empty collection, Count returns a quantity of 0. > Db.test.count ()0--Test the return value of count after inserting a document.> Db.test.insert ({"Test": 1})> Db.test.count ()1> Db.test.insert ({"Test": 2})> Db.test.count
If you have never been familiar with MongoDB or have a little understanding of MongoDB, if you are a C # developer, take a few minutes to read this article. This article will take you step by step to get started easily. Read directory 1:
SummaryThe previous article introduced CRUD operations, which will basically do a lot of work. However, if you encounter the operation of statistical classes, then you need to learn the contents of this article.Related articlesGetting started with
Http://www.cnblogs.com/yoolonet/archive/2011/08/27/2155701.html
A series of articles about MongoDB recently used MongoDB as a data storage system to record their own applications and problems in actual development. I hope this will be helpful to my
Comparison table of operations between MongoDB and MySQL and comparison table of mongodb
Comparison tables and differences between MongoDB and MySQL
MySQL and MongoDB are both open-source common databases, but MySQL is a traditional relational
Install MongoDB 3.0 server on CentOS71. Download and install
MongoDB 3.0 official version released! This marks a new development stage for MongoDB databases, providing a powerful, flexible, and easy-to-manage database management system. MongoDB
0) MONGO: Connect MongoDB database via client1) Show DBS---Display the currently created database2) Use test---Create or switch databases3) Db.dropdatabase ()--Delete the current database3) Show Collections: Displays the collection created by the
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.