title: iterating over a Mongo Cursor with finite batch size
body: <p>How can I iterate over the following data cursor? 
  Following code gives error  "</p>
  
  <blockquote>
    <p>TypeError: Object [object Object] has no method 'forEach'</p>
  </blockquote>
  
  <pre><code>var data = db.profiles.runCommand("aggregate", {
      pipeline: [
          {$limit: 100000},
          {$unwind: "$Items"},
          {   $group: {
                  _id: "$Items", count: {$sum: 1}
              },
          },
      ],
      allowDiskUse: true,
      cursor: { batchSize: 100 }
  });
  
  data.forEach(printjson) // gives error
  </code></pre>
  
  <p>data variable contains the following content</p>
  
  <pre><code>MongoDB shell version: 2.6.5
  connecting to: myCollection
  
      {
          "cursor" : {
              "id" : NumberLong("61248019114"),
              "ns" : "myCollection.profiles",
              "firstBatch" : [
                  {
                      "_id" : "alex",
                      "count" : 1
                  },
                  {
                      "_id" : "james",
                      "count" : 1
                  } .......
              },
          "ok" : 1
      }
  </code></pre>