mongoose - SchemeString, precedence of uppercase and match -


i add gender field accepts [mmff] , normalizes [mf]. here's schema:

var userschema = new schema({     name: string,     gender : { type: string, upper: true, match: /[mmff]/ } }); 

i wonder what's sequence of execution of schemestring functions. if uppercase executed before match, match [mf].

i have similar question concerning trim , match.

thanks.

answered aaron heckmann https://groups.google.com/d/msg/mongoose-orm/l5ztqdfbbwu/gyostzv1ehij

upper , trim setters - when value assigned modified.

match validator - executed later when calling .validate() or .save()


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -