Skip to content

docs(aggregation): Fix deprecated count(), add missing comma in , cla… #6294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions source/aggregation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <load-sample-data>`.

The following example pipeline uses documents from the :ref:`sample data
<sample-data>` available in MongoDB Atlas, specifically the
Expand Down Expand Up @@ -140,7 +143,7 @@ The full pipeline resembles the following:
$group : {
_id : {
"airline name": "$airline.name",
}
},
count : {
$sum: 1
}
Expand Down Expand Up @@ -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
Expand Down