title: Node + Mongoose: Get last inserted ID?
body: <p>I want to retrieve the last inserted <code>_id</code>, using mongoose as MongoDB wrapper for node.js. I've found the following tutorial, but I can't change any node modules because the app runs on a public server:</p>
  
  <p><a href="http://www.wonderlandlabs.com/wll_drupal/node/mongoose/insert_id.html" rel="noreferrer">Getting "Last Inserted ID" (hint - you have to hack Mongoose)</a></p>
  
  <p>Any other ideas? This what I want to do:</p>
  
  <ul>
  <li>Insert new user</li>
  <li>Get user's <code>_id</code> value</li>
  <li>Set a new session based on user's id</li>
  <li>Redirect to /</li>
  </ul>
  
  <p>Thanks!</p>