title: Mongoose error - no 'toObject' method after upgrade
body: <p>I have a Mongoose model in which I call the <code>toObject</code> method in a hook:</p>
  
  <pre><code>Product.post('init', function() {
     // if (typeof this.toObject === 'function') - works but why do I need it?
      this._original = this.toObject();
  });
  </code></pre>
  
  <p>This has worked fine in the pastbut after a Mongoose upgrade this error is thrown:</p>
  
  <pre><code>TypeError: Object #&lt;EventEmitter&gt; has no method 'toObject'
  at EventEmitter.Product.pre.self (/opt/run/snapshot/package/models/product.js:426:25)
  at EventEmitter.emit (events.js:95:17)
  at model.Document.(anonymous function) [as emit] (/opt/run/snapshot/package/node_modules/mongoose/lib/document.js:88:42)
  at model.Document.init (/opt/run/snapshot/package/node_modules/mongoose/lib/document.js:271:8)
  at completeMany (/opt/run/snapshot/package/node_modules/mongoose/lib/query.js:1075:12)
  at Object.cb (/opt/run/snapshot/package/node_modules/mongoose/lib/query.js:1030:11)
  at Object._onImmediate (/opt/run/snapshot/package/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
  at processImmediate [as _immediateCallback] (timers.js:345:15)
  </code></pre>
  
  <p>I should note that this occurs when launching the app. I can do a check to prevent error but the issue is that I need the toObject function and would like to understand how this error can be thrown. </p>
  
  <p>I am not finding docs on any changes. Any ideas?</p>
  
  <p><strong>Edit</strong> I realized my issue was caused by a loose <code>package.json</code> spec for Mongoose which caused my host (nodejitsu) to use what I think is a <code>4.x</code> version instead of my local <code>3.8.x</code> branch. If I lock down the version exactly the problem does not occur.</p>