[DOCS-7320] Comment on: "primer/aggregation.txt" Created: 01/Mar/16  Updated: 08/Dec/16  Resolved: 28/Mar/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OSX terminal

Location: https://docs.mongodb.org/getting-started/node/aggregation/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:44.0) Gecko/20100101 Firefox/44.0
Referrer: https://docs.mongodb.org/getting-started/node/remove/
Screen Resolution: 1280 x 800
repo: docs
source: aggregation


Participants:
Days since reply: 7 years, 50 weeks, 1 day ago
Epic Link: docs-primer

 Description   

the functions on this page do not run properly in the node shell

> var aggregateRestaurants = function(db, callback) {
... db.collection('restaurants').aggregate(
..... [
..... { $match:

{ "borough": "Queens", "cuisine": "Brazilian" }

},
..... { $group: { "_id": "$address.zipcode" , "count":

{ $sum: 1 }

} }
..... ]).toArray(function(err, result)

{ ....... assert.equal(err, null); ....... console.log(result); ....... callback(result); ....... }

SyntaxError: missing ) after argument list
at Object.exports.createScript (vm.js:24:10)
at REPLServer.defaultEval (repl.js:225:25)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:417:12)
at emitOne (events.js:95:20)
at REPLServer.emit (events.js:182:7)
at REPLServer.Interface._onLine (readline.js:211:10)
at REPLServer.Interface._line (readline.js:550:8)
at REPLServer.Interface._ttyWrite (readline.js:827:14)
> );
... };


Generated at Thu Feb 08 07:54:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.