Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-7320

Comment on: "primer/aggregation.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    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)
      > );
      ... };

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 50 weeks, 1 day ago