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
63
63
64
64
Aggregation Pipeline Example
65
65
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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>`.
66
69
67
70
The following example pipeline uses documents from the :ref:`sample data
68
71
<sample-data>` available in MongoDB Atlas, specifically the
@@ -140,7 +143,7 @@ The full pipeline resembles the following:
140
143
$group : {
141
144
_id : {
142
145
"airline name": "$airline.name",
143
- }
146
+ },
144
147
count : {
145
148
$sum: 1
146
149
}
@@ -186,9 +189,10 @@ aggregation pipeline.
186
189
- Returns an approximate count of the documents in a collection or
187
190
a view.
188
191
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).
192
196
193
197
* - :method:`db.collection.distinct()`
194
198
- Returns an array of documents that have distinct values for the
You can’t perform that action at this time.
0 commit comments