title: Mongoose virtual set function not called when value is object
body: <p>I have a mongoose schema with a virtual of mixed type. For example:</p>
  <pre><code>var mongoose = require('mongoose') // version 3.3.1
  
  var FooSchema = new mongoose.Schema( { x: Number } );
  
  FooSchema.virtual('v').set( function(value){ 
    console.log(&quot;SETTING&quot;, value); 
  });
  
  var Foo = mongoose.model('Foo', FooSchema);
  
  new Foo( { v:1 } );
  new Foo( { v:[] } );
  new Foo( { v:{} } );
  </code></pre>
  <p>When I run this code I get:</p>
  <pre><code>SETTING 1
  SETTING []
  </code></pre>
  <p>As you'll notice it never shows &quot;SETTING {}&quot;, any reason why this doesn't work?</p>
  <p><a href="https://github.com/LearnBoost/mongoose/issues/1154" rel="nofollow noreferrer">Reference to issue on Github</a></p>