diff --git a/source/aggregation.txt b/source/aggregation.txt index c6e859d5d0..35b976d634 100644 --- a/source/aggregation.txt +++ b/source/aggregation.txt @@ -63,6 +63,9 @@ Aggregation Pipelines Aggregation Pipeline Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. note:: + To run this example, load the ``sample_training`` dataset in MongoDB Atlas. + See :ref:`how to load sample data `. The following example pipeline uses documents from the :ref:`sample data ` available in MongoDB Atlas, specifically the @@ -140,7 +143,7 @@ The full pipeline resembles the following: $group : { _id : { "airline name": "$airline.name", - } + }, count : { $sum: 1 } @@ -186,9 +189,10 @@ aggregation pipeline. - Returns an approximate count of the documents in a collection or a view. - * - :method:`db.collection.count()` - - Returns a count of the number of documents in a collection or a - view. + * - :method:`db.collection.countDocuments()` + - Returns an exact count of documents matching optional criteria. + * - :method:`db.collection.estimatedDocumentCount()` + - Returns a fast approximate count (no query filter support). * - :method:`db.collection.distinct()` - Returns an array of documents that have distinct values for the