Skip to content

Commit 098527d

Browse files
npentreljeff-allen-mongo
authored andcommitted
DOCS-11860: $facet stage size limits
1 parent 4a9f3c7 commit 098527d

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

source/core/aggregation-pipeline-limits.txt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,14 @@ following limitations.
1616
Result Size Restrictions
1717
------------------------
1818

19-
.. versionchanged:: 3.6
20-
21-
MongoDB 3.6 removes the option for the :dbcommand:`aggregate`
22-
command to return its results as a single document.
23-
2419
The :dbcommand:`aggregate` command can either return a cursor or store
25-
the results in a collection. When returning a cursor or storing the
26-
results in a collection, each document in the result set is subject to
27-
the :limit:`BSON Document Size` limit, currently 16 megabytes; if any
28-
single document exceeds the :limit:`BSON Document Size` limit, the
29-
command produces an error. The limit only applies to the returned
30-
documents; during the pipeline processing, the documents may exceed this
31-
size. The :method:`db.collection.aggregate()` method returns a cursor by
32-
default.
20+
the results in a collection. Each document in the result set is subject
21+
to the 16 megabyte :limit:`BSON Document Size limit <BSON Document
22+
Size>`. If any single document exceeds the :limit:`BSON Document Size
23+
limit <BSON Document Size>`, the aggregation produces an error. The
24+
limit only applies to the returned documents. During the pipeline
25+
processing, the documents may exceed this size. The
26+
:method:`db.collection.aggregate()` method returns a cursor by default.
3327

3428
.. _agg-memory-restrictions:
3529

source/includes/fact-agg-memory-limit.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,4 @@ Examples of stages that can spill to disk when :ref:`allowDiskUse
3636
If the results of one of your :pipeline:`$sort` pipeline stages exceed
3737
the limit, consider :ref:`adding a $limit stage <sort-limit-sequence>`.
3838

39-
.. versionchanged:: 3.4
40-
41-
.. include:: /includes/fact-graphlookup-memory-restrictions.rst
42-
4339
.. include:: /includes/extracts/4.2-changes-usedDisk.rst

source/reference/operator/aggregation/facet.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ Definition
4949

5050
Specify the output field name for each specified pipeline.
5151

52+
Considerations
53+
--------------
54+
55+
The output of the :pipeline:`$facet` stage is subject to the 16 megabyte
56+
:limit:`BSON Document Size limit <BSON Document Size>`. If the results
57+
of the :pipeline:`$facet` stage exceed the :limit:`BSON Document Size
58+
limit <BSON Document Size>`, the aggregation produces an error.
59+
60+
.. seealso::
61+
62+
:doc:`/core/aggregation-pipeline-limits`
63+
5264
Behavior
5365
--------
5466

0 commit comments

Comments
 (0)