jedireza/aqua

Mongo indexes `unique: 1` is in wrong place

Closed this issue · 2 comments

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

aqua/server/models/user.js

Lines 203 to 206 in ea085be

User.indexes = [
{ key: { username: 1, unique: 1 } },
{ key: { email: 1, unique: 1 } }
];

Proper structure example:

User.indexes = [ 
     { key: { username: 1 }, unique: true }, 
     { key: { email: 1 }, unique: true } 
 ]; 

Yep. We need a PR just like jedireza/frame#178

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