title: Create unique autoincrement field with mongoose
body: <p>Given a Schema:</p>
  
  <pre><code>var EventSchema = new Schema({
      id: {
          // ...
      },
      name: {
          type: String
      },
  });
  </code></pre>
  
  <p>I want to make <code>id</code> unique and autoincrement. I try to realize <a href="http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/">mongodb implementation</a> but have problems of understanding how to do it right in mongoose. </p>
  
  <p><strong>My question is</strong>: what is the right way to implement autoincrement field in mongoose without using any plugins and so on?</p>