You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because a unique constraint index isn't created on accounts.email, my application allows
// directly in mongodbdb.account.update({_id: 100},{$set: {email: "[email protected]"}})// from mongoose where account is a documentaccount.update({email: "[email protected]"},function(uerr,numUpdated,raw){ ... });
to go completely unchecked, thus allowing 2+ users with the same username.
I am working around it by specifically defining email in my account schema like this:
We also ended up with 2 accounts for the same user, apparently due to user double clicking the signup button. Manually added unique: true to our user field.
This may be a problem with the default
username
field as well, but since I'm using custom to set it to "email," I can't as yet validate the case.When using
mongoose.set('debug', true);
I will see in the console:What I expect to see is in the console is:
Because a
unique
constraint index isn't created onaccounts.email
, my application allowsto go completely unchecked, thus allowing 2+ users with the same username.
I am working around it by specifically defining
email
in myaccount
schema like this:... but I would expect this to be done already.
The text was updated successfully, but these errors were encountered: