I have the following code that checks my timezone field:
orgSchema.path('timezone').validate(function(value) { return Timezone.findOne({_id: value}, "_id", function (err, timezone) { return false; }); }, "Please provide a valid timezone");
The field always passes even when I add "return false" to the innermost function. I know that somewhere I miss the callback - I would appreciate help.
source share