Closed ryancmoon closed 7 years ago
Hi. You're correct, this is an async issue. Your validator isn't actually returning any value, the callback is. All validators should be synchronous. If I get time in the future I may look at providing some kind of async support with promises.
Ahh. Thanks for the quick reply. Cheers.
My custom validator is returning true/false, which seems to follow the documentation, but it is being ignored. I suspect this might be an async issue, but the default-return is false on this function:
user is correctly "null" when an invalid _id is passed as value, and a user object when a valid one is passed. However, mongoose-validator does not seem to respect the returned boolean.