title: MongoDB via Mongoose JS - What is findByID?
body: <p>I am writing a NodeJS server with ExpressJS, PassportJS, MongoDB and MongooseJS. I just managed to get PassportJS to use user data obtained via Mongoose to authenticate.</p>
  
  <p>But to make it work, I had to use a "findById" function like below.</p>
  
  <pre><code>var UserModel = db.model('User',UserSchema);
  
  UserModel.findById(id, function (err, user) { &lt; SOME CODE &gt; } );
  </code></pre>
  
  <p><code>UserModel</code> is a Mongoose model. I declare the schema, <code>UserSchema</code> earlier. So I suppose <code>UserModel.findById()</code> is a method of the Mongoose model?</p>
  
  <p><strong>Question</strong></p>
  
  <p>What does <code>findById</code> do and is there documentation on it? I googled around a bit but didn't find anything.</p>