I am trying to make email as unique. I tried using 'unique' and 'dropDups', but it doesn't work. Any idea what I should use?
var custSchema = new Schema({
"username": String,
"Password": String,
"email": {["Type": String,
"Value": { type : String, lowercase: true, unique: true, dropDups: true}]
})
Example of csv data:
username Password Email
Type Value
User1: test1 asdub**jhas Primary test1@user1.com
User2: test2 3kjnn**8man Primary Pract@test.com
User3: test3 dsffs**as97 Primary test1@user1.com
In this example case, there would be only two users added to the database: User1 and User2, because User3 has the same email address as User1.
Thanks for helping.