title: mongooseJS with TypeError: Cannot read property 'constructor' of undefined
body: <p>I'm trying to update data in a database by reading data from a file and using the 'update' method.  </p>
  
  <pre><code>var Model = require('./dbIndex').Model
  
  BioMetrics.update({AID: AID}, 
    {$pushAll: {
    attr1: data[5] === '' ? undefined : {val: data[5], dt: date},
    attr2: data[6] === '' ? undefined : {val: data[6], dt: date},
    attr3: data[10] === '' ? undefined : {val: data[10], dt: date}
   }}, options, callback);
  </code></pre>
  
  <p>When I run this I get the following error:<br>
  <code>TypeError: Cannot read property 'constructor' of undefined</code></p>
  
  <p>Mongo does not know what <code>undefined</code> means?  I had the impression that when undefined is true Mongo just ignores that attribute.  </p>
  
  <p>Can someone explain what's happening here?</p>