jedireza / frame

:bulb: A user system API starter
https://jedireza.github.io/frame/
MIT License
740 stars 157 forks source link

Update unique index syntax in user.js #178

Closed richardzyx closed 6 years ago

richardzyx commented 6 years ago

I believe this is the correct syntax for unique indexing? Tested on mlab.

Thanks!

jedireza commented 6 years ago

Thanks for opening an issue. I think I did the same thing at one point but IIRC this isn't the correct approach. Mind sharing a link to the docs you saw this in?

richardzyx commented 6 years ago

Feel free to test it yourself, the current one doesn't work and I got this syntax from one of the PRs for hapi-mongo-models: https://github.com/jedireza/hapi-mongo-models/issues/69 Detailed document on MongoDB can be found here: https://docs.mongodb.com/manual/reference/command/createIndexes/ unique field is on the same level with key

jedireza commented 6 years ago

Thanks for the links. I'll test and confirm this when I get some time.

jedireza commented 6 years ago

Thank you again. This was a big oversight on my part. 😆

richardzyx commented 6 years ago

Haha keep up the great work! Thanks!