title: Mongoose duplicates with the schema key unique
body: <p>I want to make the key project unique across that collection but i cant getting this working, i found similar problem here.</p>
  
  <p>task.js</p>
  
  <pre><code>function make(Schema, mongoose) {
  
      var Tasks = new Schema({
          project: { type: String, index: { unique: true, dropDups: true }},
          description: String
      });
  
      mongoose.model('Task', Tasks);
  }
  module.exports.make = make;
  </code></pre>
  
  <p>test.js</p>
  
  <pre><code>var mongoose = require('mongoose');
  mongoose.connect('mongodb://localhost/rss');
  
  var Schema = mongoose.Schema
    , ObjectId = Schema.ObjectId;
  
  require('./task.js').make(Schema, mongoose);
  var Task = mongoose.model('Task');
  var newTask = new Task({
      project: 'Starting new project'
    , description: 'New project in node'
  });
  newTask.save(function(err) {
      if (err) console.log('Error on saving');
  });
  
  mongoose.disconnect();
  </code></pre>
  
  <p>When i run the app with node test.js, still creates duplicates.</p>
  
  <pre><code>MongoDB shell version: 2.0.2
  connecting to: rss
  &gt; db.tasks.find()
  &gt; db.tasks.find()
  { "project" : "Starting new project", "description" : "New project in node", "_id" : ObjectId("4f21aaa3d48d4e1533000001") }
  { "project" : "Starting new project", "description" : "New project in node", "_id" : ObjectId("4f21aaa4d9a8921a33000001") }
  { "project" : "Starting new project", "description" : "New project in node", "_id" : ObjectId("4f21aaa57ebeea1f33000001") }
  </code></pre>
  
  <p>// Edit still same problem, here's what i tried to do
  delete the db.tasks.drop() collection
  restart mongo sudo stop mongodb and start mongodb, ran the program again and still same problem, how does it allow duplicate data on index?</p>