Object.keys called on non-object with Node.js and MongoDB Stream

I want to retrieve a large JSON chunks from MongoDB using Node.js

Here's json in MongoDB:

{
  "nid": "nanodev-0000000015",
  "unixtime": NumberInt(1416561973),
  "cpuload": "0.71",
  "cpucore": NumberInt(1),
  "memload": "39.9%",
  "memused": "196.2 MB",
  "memtotal": "491.7 MB",
  "diskload": "18%",
  "diskused": "1666 MB",
  "disktotal": "10079 MB"
}

Here's my code, with MongoDB stream for a large JSON chunks:

var fetchedDocs = [];

db.collection('agent', function(err, collection) {
     var stream = collection.find().stream()

     stream.on('error', function (err) {
          console.error(err);
     )

     stream.on('data', function (item) {
          fetchedDocs.push(item);
     })

     stream.on("end", function() {
         fs.writeFile('file.xlsx', json2xls(fetchedDocs), 'binary', function (err) {
         if(err) console.error(err);
         else {
             console.log('write file finished');
         } 
         db.close();
    });
});

Here's the error

TypeError: Object.keys called on non-object

Could anyone tell me what happened? please give me some suggestions