title: Mongoose password hashing
body: <p>I am looking for a good way to save an Account to MongoDB using mongoose.</p>
  
  <p>My problem is: The password is hashed asynchronously. A setter wont work here because it only works synchronous.</p>
  
  <p>I thought about 2 ways:</p>
  
  <ul>
  <li><p>Create an instance of the model and save it in the callback of the
  hash function.</p></li>
  <li><p>Creating a pre hook on 'save'</p></li>
  </ul>
  
  <p>Is there any good solution on this problem?</p>