title: mongoose: unique field isn't working
body: <p>I'm trying to find out how to enforce unique on a field which isn't an index.</p>
  
  <p>I've seen similar question in here, but the answer of using <strong>dropDups: true</strong> is mentioned to be depcrated.</p>
  
  <p>what is the correct way of enforcing unique on a field?</p>
  
  <pre><code>const users = new Schema({
  email: { type: String, required: true , unique: true},
  ...});
  </code></pre>