These are chat archives for Automattic/mongoose

Feb 2018
Luis Carlos Garcia Barajas
Feb 18 2018 07:16
With node 8
Feb 18 2018 22:26
@lineus Thanks for checking into that for me
The next issue I've run into is where I need ot require that one of a set of fields are defined, for example in the case of various oauth and local authentication providers, where I would need to make 'password' OR '' OR '' required, but if either of the latter had values, explicitly NOT require a password. Is there a way to perform this type of validation, or should I just use an internally set, bogus password and an authProvider field or similar?
Feb 18 2018 22:34
My initial workaround looks like this: authProvider: {type: String, enum: ['local', 'fb','twitter'], default: 'local' }, but if there's a way to do the type of field validation described above, that'd be a far superior solution. Thanks