title: How to add binary data with objectId to mongoDB?
body: <p>I need to insert a document into a collection, which has an <code>ObjectId</code> and a <code>BinData</code> value. Therefore I don't know how to insert it.</p>
  
  <p>With this code I get the error <code>TypeError: Cannot read property 'ObjectId' of undefined</code>.</p>
  
  <p><strong>server/fixtures.js</strong></p>
  
  <pre><code>var ObjectId = Mongo.ObjectID;
  var chunk = {
              "_id"     : ObjectId("57a9be3c89c1e4b50c574e3a"),
              "files_id": ObjectId("5113b0062be53b231f9dbc11"),
              "n"       : 0,
              "data"    : BinData(0, "/9j/4AAQSkZJRgA...and...so...on../2Q==")
          };
  
  db.mediafiles.chunks.insert(chunk);
  </code></pre>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>I'm using <strong>Meteor</strong></p>
  
  <p>Therefore I can use <code>var ObjectId = Meteor.Collection.ObjectID;</code>. But how do I get the <code>BinData</code>?</p>
  
  <p><code>ReferenceError: BinData is not defined</code></p>