Aggregation Pipeline Limits¶
Aggregation operations with the
aggregate command have the
Result Size Restrictions¶
aggregate command returns a single document that
contains the complete result set, the command will produce an error if
the result set exceeds the
BSON Document Size limit, which is
currently 16 megabytes. To manage result sets that exceed this limit,
aggregate command can return result sets of any size
if the command return a cursor or store the results to a collection.
Changed in version 2.6.
Pipeline stages have a limit of 100 megabytes of RAM. If a stage
exceeds this limit, MongoDB will produce an error. To allow for the
handling of large datasets, use the
allowDiskUse option to enable
aggregation pipeline stages to write data to temporary files.