It happens that if a second account is created using a service with an email which is already used for another account, mongodb complains about duplicated value for the field emails on which there is and index with unique constraint.
I hoped this error was pushed up to the client eventually forbidding the new account creation, but this was not the case the final result being the new account be created WITHOUT the emails field.
with commit @98ed642bd4ea74e3fd963aa01028284f52bb8d52 I switched from emails to 'registered_emails` which will be kept in parallel to allow for user search by email address.
It happens that if a second account is created using a service with an email which is already used for another account, mongodb complains about duplicated value for the field
emails
on which there is and index with unique constraint.I hoped this error was pushed up to the client eventually forbidding the new account creation, but this was not the case the final result being the new account be created WITHOUT the
emails
field.with commit @98ed642bd4ea74e3fd963aa01028284f52bb8d52 I switched from
emails
to 'registered_emails` which will be kept in parallel to allow for user search by email address.