Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect regex for compound keys #48

Open
men232 opened this issue Mar 14, 2018 · 1 comment
Open

Incorrect regex for compound keys #48

men232 opened this issue Mar 14, 2018 · 1 comment

Comments

@men232
Copy link

men232 commented Mar 14, 2018

Hey, have a issues with this error message parsing E11000 duplicate key error index: heroku_4k0w7dhh.users.$email_1 dup key:.

Current regex parse this as: heroku_4k0w7dhh.users.$email_1.
Actually these are my collection indexes:

{ name_1: [ [ 'name', 1 ] ],
  email_1: [ [ 'email', 1 ] ],
  _id_: [ [ '_id', 1 ] ],
  phone_1: [ [ 'phone', 1 ] ] } 

As a result, I do not get a beautiful error.

men232 pushed a commit to men232/mongoose-beautiful-unique-validation that referenced this issue Mar 14, 2018
@sato-sh
Copy link

sato-sh commented Apr 3, 2018

I too am experiencing this same issue and the PR seems to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants