From c43dc208ac167ea1431baa2d1bf4b3a738fd0404 Mon Sep 17 00:00:00 2001 From: Steve Renaker Date: Mon, 9 Jan 2017 13:58:09 -0800 Subject: [PATCH] DOCS-9742: fix aggregation example --- docs/reference/content/tutorials/aggregation.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/reference/content/tutorials/aggregation.md b/docs/reference/content/tutorials/aggregation.md index 45ad02b104..6b2bf447fd 100644 --- a/docs/reference/content/tutorials/aggregation.md +++ b/docs/reference/content/tutorials/aggregation.md @@ -29,9 +29,9 @@ and operators, see the [manual:](https://docs.mongodb.com/manual/core/aggregation-pipeline/) The following example uses the aggregation pipeline on the -``restaurants`` sample dataset to find -a list of the total number of 5-star restaurants, grouped by restaurant -category. +[restaurant](https://docs.mongodb.org/getting-started/node/import-data/) +sample dataset to find a list of restaurants located in the Bronx, +grouped by restaurant category. ```js var MongoClient = require('mongodb').MongoClient @@ -48,9 +48,9 @@ MongoClient.connect(url, function(err, db) { var simplePipeline = function(db, callback) { var collection = db.collection( 'restaurants' ); collection.aggregate( - [ { '$match': { "stars": 5 } }, + [ { '$match': { "borough": "Bronx" } }, { '$unwind': '$categories'}, - { '$group': { '_id': "$categories", 'fiveStars': { '$sum': 1 } } } + { '$group': { '_id': "$categories", 'Bronx restaurants': { '$sum': 1 } } } ], function(err, results) { assert.equal(err, null); @@ -179,5 +179,3 @@ var simpleDistinct = function(db, callback) { ); } ``` - -