Reuse Mongoose schema in client code Reuse Mongoose schema in client code mongoose mongoose

Reuse Mongoose schema in client code


You may assign validators directly to your schema. I assume that Mongoose prototype cannot be render on the client side, moreover it needs lots of work to map it against Angular's way-of-validating models. Furthermore is a lack of security validating only on the client side.

It's quite easy to use AJAX call from your Angular application serialise your model and parse it to your Express listener.Since your schema has validators, no malformed data will be parsed into your collection.