title: MongoDB group query works in terminal, throws error in nodejs file
body: <p>I've got a query that works fine in the terminal querying my mongodb collection, however inside of the function that I want to group the data, I'm getting the following error:</p>
  
  <pre><code>// QUERY WORKS:
  /*
  &gt; db.twitterhashtags.group({ key: {"text":true}, initial: {sum:0}, reduce: function(doc, prev) {prev.sum +=1}});
   [
  {
      "text" : "spnyc",
      "sum" : 1
  },
  {
  */
  //RUNNING QUERY CAUSES THIS ERROR:
  // TypeError: undefined is not a function
  // at Collection.group.scope (/Users/propstm/Projects/nodeproject/node_modules/mongoskin/node_modules/mongodb/lib/mongodb/collection.js:1341:16)
  //at g (events.js:185:14)
  </code></pre>
  
  <p>This is the line of code that throws the error shown above.</p>
  
  <pre><code>db.collection("twitterhashtags").group({ key: {"text":true}, initial: {sum:0}, reduce: function(doc, prev) {prev.sum +=1}});
  </code></pre>