MongoDB aggregation Error

Source: Internet
Author: User
Tags install mongodb
An aggregation framework is a new framework for data aggregation. It is similar to a data processing pipeline. Each document uses a pipeline composed of multiple nodes. Each node has its own special

An aggregation framework is a new framework for data aggregation. It is similar to a data processing pipeline. Each document uses a pipeline composed of multiple nodes. Each node has its own special

An aggregation framework is a new framework for data aggregation. It is similar to a data processing pipeline. Each document uses a pipeline composed of multiple nodes. Each node has its own special functions (grouping, filtering, etc.). After the documents are processed by pipelines, the corresponding results are output.

MPs queue has two basic functions:

One is to filter documents, that is, to filter out qualified documents;

The second is to "change" the document, that is, to change the output form of the document.

Errmsg: Exceeded memory limit for $ group, but didn't allow external Sort. Pass allowDiskuse: true

Error details:

The data volume of the table I used this time is: about 4 million data.

What I want to check is: the first five users who receive the most information

Write the analysis statement strictly in accordance with the syntax;

Now that there is a problem, let's Debug (we have the power of code farming)

If the pipeline does not provide the expected results, debugging is required. During debugging, you can specify only the first pipeline operator. If this produces the expected results, then specify the second pipeline operator, in the above example, first try to aggregate the $ project operator. If the result of this operator is valid, add the $ group operator,

If the result is valid, add $ sort, and then add the $ limit operator. In this way, you can locate the operator that causes the problem gradually.

Step-by-Step debugging finds that no problem is not a syntax error

The reason is that the aggregation results must be limited to 16 MB (the maximum size of information affected by mongodb ), otherwise, it must be cached in the disk (allowDiskUse = True ).

Finally, let's figure out the data to be collected.

For more information about MongoDB, see the following links:

MongoDB 3.0 official version released and downloaded

CentOS compilation and installation of MongoDB

CentOS compilation and installation of php extensions for MongoDB and mongoDB

CentOS 6 install MongoDB and server configuration using yum

Install MongoDB2.4.3 in Ubuntu 13.04

MongoDB beginners must read (both concepts and practices)

MongoDB Installation Guide for Ubunu 14.04

MongoDB authoritative Guide (The Definitive Guide) in English [PDF]

Nagios monitoring MongoDB sharded cluster service practice

Build MongoDB Service Based on CentOS 6.5 Operating System

MongoDB details: click here
MongoDB: click here

This article permanently updates the link address:

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.