title: GridFS put() with Mongoose dies in write concern code?
body: <p>I have the following code (trimmed, assume all the closing stuff is there), which dies deep down inside GridFS: </p>
  
  <pre><code>var Grid = require('mongodb').Grid;
  var mongoose = require('mongoose');
  var db = mongoose.connect('mongodb://localhost:27017/ksnap');
  
  router.route('/').post(function(req, res) {
  
      var post = new Post();
      var busboy = new Busboy({ headers: req.headers });
  
      req.pipe(busboy);
  
      busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
  
          console.log('File [' + fieldname + ']: filename: ' + filename + ', encoding: ' + encoding + ', mimetype: ' + mimetype);
          if (fieldname != 'img') { return; }
  
          var bufs = [];
  
          file.on('data', function(data) {
              console.log('File [' + fieldname + '] got ' + data.length + ' bytes');
  
              bufs.push(data);
  
          }); // busboy file on data
  
          file.on('end', function() {
              console.log('File [' + fieldname + '] Finished');
  
              var buf = Buffer.concat(bufs);
  
              var grid = new Grid(db, 'fs');
              grid.put(buf, {metadata:{category:'image'}, content_type: 'image'}, function(err, result) {
                  if (err) { console.log(err); } else { console.log(result); }
              });
  </code></pre>
  
  <p>Stack trace: </p>
  
  <pre><code>/opt/ksnap-server/node_modules/mongodb/lib/mongodb/gridfs/gridstore.js:1552
    } else if(self.safe.w != null || typeof self.safe.j == 'boolean' || typeof s
                       ^
  TypeError: Cannot read property 'w' of undefined
      at _getWriteConcern (/opt/ksnap-server/node_modules/mongodb/lib/mongodb/gridfs/gridstore.js:1552:22)
      at Stream.GridStore (/opt/ksnap-server/node_modules/mongodb/lib/mongodb/gridfs/gridstore.js:100:23)
      at Grid.put (/opt/ksnap-server/node_modules/mongodb/lib/mongodb/gridfs/grid.js:52:19)
      at FileStream.&lt;anonymous&gt; (/opt/ksnap-server/server.js:83:13)
      at FileStream.emit (events.js:117:20)
      at _stream_readable.js:943:16
      at process._tickCallback (node.js:419:13)
  </code></pre>
  
  <p>Busboy returns a stream which I put into a buffer, so far so good. This works fine, I've tested it. But when I try to grid.put() the buffer, it dies as above. I've tried to trace it, but I'm having trouble. <s>As far as I can tell, the all the options get eaten in grid.js, so by the time they get passed down to gridstore.js it's just an empty object.</s> Mongoose just doesn't set this, I guess.</p>