title: Mongodb & Mongoose not creating unique index
body: <p>I've searched the internet extensively, and no one seems to have an answer for this problem. I have a Mongoose Schema tied to a DB in Mongo. I want to create a unique index on the email field of my User document. The code below should work, as far as I can tell from the limited documentation I could find. Can anyone tell me why it fails, and allows me to create users with duplicate emails?</p>
  
  <pre><code>var userSchema = new Schema({
      email: { type: String, required: true, index: { unique: true, trim: true } },
      password: String,
      firstName: String,
      lastName: String
   }, { autoIndex: true });
  </code></pre>