File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ Aggregation Pipelines
6363
6464Aggregation Pipeline Example
6565~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66+ .. note::
67+ To run this example, load the ``sample_training`` dataset in MongoDB Atlas.
68+ See :ref:`how to load sample data <load-sample-data>`.
6669
6770The following example pipeline uses documents from the :ref:`sample data
6871<sample-data>` available in MongoDB Atlas, specifically the
@@ -140,7 +143,7 @@ The full pipeline resembles the following:
140143 $group : {
141144 _id : {
142145 "airline name": "$airline.name",
143- }
146+ },
144147 count : {
145148 $sum: 1
146149 }
@@ -186,9 +189,10 @@ aggregation pipeline.
186189 - Returns an approximate count of the documents in a collection or
187190 a view.
188191
189- * - :method:`db.collection.count()`
190- - Returns a count of the number of documents in a collection or a
191- view.
192+ * - :method:`db.collection.countDocuments()`
193+ - Returns an exact count of documents matching optional criteria.
194+ * - :method:`db.collection.estimatedDocumentCount()`
195+ - Returns a fast approximate count (no query filter support).
192196
193197 * - :method:`db.collection.distinct()`
194198 - Returns an array of documents that have distinct values for the
You can’t perform that action at this time.
0 commit comments