Skip to content

Commit 5af3a2e

Browse files
authored
Merge pull request #93 from mcmorisi/DOCSP-45076-count-match-2
DOCSP-45076: Document that count supports different filters from countDocuments
2 parents c2b53c0 + 171eaee commit 5af3a2e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/reference/aggregation.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ find the total number of documents which have the exact array
9898

9999
count = coll.count({ 'categories' => [ 'Chinese', 'Seafood' ] })
100100

101+
.. note::
102+
103+
The ``count`` method is not the same as the ``countDocuments``
104+
method and may not support the same filters. ``countDocuments`` uses the
105+
``$match`` stage of the aggregation pipeline to filter documents. To learn more
106+
about limitations of the ``$match`` stage, see :manual:`$match Restrictions </reference/operator/aggregation/match/#restrictions>`
107+
in the MongoDB Server manual.
108+
101109
Distinct
102110
~~~~~~~~
103111

0 commit comments

Comments
 (0)