O'Reilly logo
  • Patrick S thinks this is interesting:

For example, if we want to ensure that there is only ever one user per e-mail address, we can specify that the email field should be unique.

email: {type: String, unique:true}

From

Cover of Mongoose for Application Development

Note

set unique value (schema)