Skip to content

Commit c43dc20

Browse files
committed
DOCS-9742: fix aggregation example
1 parent ae67052 commit c43dc20

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

docs/reference/content/tutorials/aggregation.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ and operators, see the
2929
[manual:](https://docs.mongodb.com/manual/core/aggregation-pipeline/)
3030

3131
The following example uses the aggregation pipeline on the
32-
``restaurants`` sample dataset to find
33-
a list of the total number of 5-star restaurants, grouped by restaurant
34-
category.
32+
[restaurant](https://docs.mongodb.org/getting-started/node/import-data/)
33+
sample dataset to find a list of restaurants located in the Bronx,
34+
grouped by restaurant category.
3535

3636
```js
3737
var MongoClient = require('mongodb').MongoClient
@@ -48,9 +48,9 @@ MongoClient.connect(url, function(err, db) {
4848
var simplePipeline = function(db, callback) {
4949
var collection = db.collection( 'restaurants' );
5050
collection.aggregate(
51-
[ { '$match': { "stars": 5 } },
51+
[ { '$match': { "borough": "Bronx" } },
5252
{ '$unwind': '$categories'},
53-
{ '$group': { '_id': "$categories", 'fiveStars': { '$sum': 1 } } }
53+
{ '$group': { '_id': "$categories", 'Bronx restaurants': { '$sum': 1 } } }
5454
],
5555
function(err, results) {
5656
assert.equal(err, null);
@@ -179,5 +179,3 @@ var simpleDistinct = function(db, callback) {
179179
);
180180
}
181181
```
182-
183-

0 commit comments

Comments
 (0)