jedireza / aqua

:bulb: A website and user system starter
https://jedireza.github.io/aqua/
MIT License
1.38k stars 356 forks source link

Mongo indexes `unique: 1` is in wrong place #272

Closed symbianm closed 6 years ago

symbianm commented 6 years ago

Based on Mongo documentation unique: true should be outside of the key object.

https://github.com/jedireza/aqua/blob/ea085be912494561149e1899d68cb468e5e0d144/server/models/user.js#L203-L206

Proper structure example:

User.indexes = [ 
     { key: { username: 1 }, unique: true }, 
     { key: { email: 1 }, unique: true } 
 ]; 
jedireza commented 6 years ago

Yep. We need a PR just like https://github.com/jedireza/frame/pull/178

jedireza commented 6 years ago

I've decided to archive this project. Thank you for your interest and contributions. https://github.com/jedireza/aqua#no-longer-maintained