title: NodeJS acess fs.chunks from fs.files
body: <p>I am using <strong>GridFS</strong> to retrive image from mongoDB:</p>
  
  <p>I do:</p>
  
  <pre><code>    // Connect to the db
      MongoClient.connect("mongodb://10.8.2.232/mydb", function(err, db) {
        if(err) return console.dir(err);
                  var fileId = mongoose.Types.ObjectId("542e684a8a1cec178a172671");
                  var gridStore = new GridStore(db, fileId, 'r');
  
                  gridStore.open(function (err, gridStore) {
                      //console.log(gridStore.currentChunk.data.buffer);
                      gridStore.read(function (error,data){
                          console.log(data, 'binary');
                          res.writeHead(200, {'Content-Type': 'image/png'});
                          var s = gridStore.stream(true);
                          console.log(s);
                      });
                  });
      });
      }).listen(8124, "127.0.0.1");
  
  console.log('Server running at http://127.0.0.1:8124/');
  </code></pre>
  
  <p>Connexion to MongoDB OK
  "S" displays a JSON  with some information about the image:</p>
  
  <pre><code>currentChunk:
    { file: [Circular],
      writeConcern: [Object],
      objectId: 542e65378a1cec1227ae2bb1,
      chunkNumber: 0,
      data: [Object],
      internalPosition: 17959 } },
  </code></pre>
  
  <p>But I want to display the image:</p>
  
  <p>fs.chunks:</p>
  
  <pre><code>{
          "_id" : ObjectId("542e684a8a1cec1745zs3"),
          "n" : 1,
          "data" : BinData(0,"2N6DSSfbCN/LLacNDYrJUQDEZgimMUwFpQGoJP0RU19Bi4PM82DjrUnKhE/P9v7P8ZveD1oDpFBM0iml9NE3WQmAvYFoG+nhD73Jm4N9b4LpylaAN5Ef+gVdgGSTAfSUwOikXoVick5pSQCkRmTCU5NT9VVfjHdAx74/ZhFRj+TIRjzlAhzkACBElzgMwGCo7tX+FYrpQLJ5KRmXiwF"),
          "files_id" : ObjectId("542e684a8a1cec178a172671")
  }
  </code></pre>
  
  <p>How I can be able to retrieve my image (in data) in the browser?</p>
  
  <p>Thanks!</p>