import mongodb from 'mongoose';

export default mongodb.model('User', new mongodb.Schema({
    name: {
        type: String,
        required: [true, 'User name is required!']
    },
    email: {
        type: String,
        required: [true, 'E-mail is required!']
    },
    password: {
        type: String,
        required: [true, 'Password is required!'],
        minlength: [4, 'Password is too short!']
    },
    created: Date
}));

@@ -203,32 +203,54 @@
   type: String,%0A
+        unique: true,%0A
         required

Consider in the user schema the email as unique