Schema
const schema = lounge.schema({
name: String,
email: { type: String, index: true, indexType: 'array', refKeyCase: 'lower' }
})
schema.pre('save', function (next) {
if (this.email) {
this.email = this.email.toLowerCase();
}
next();
});
const User = lounge.model('User', schema);
const user = new User({
name: 'Bob',
email: 'BOB@gmail.com'
});
user.save({ waitForIndex: true }, (err, saved) => {
// ...
});
Investigate possible issues with this setup.
@scdowney @atrites Please add details.
Schema
Investigate possible issues with this setup.
@scdowney @atrites Please add details.