# mongoosejs: setters schema

According to mongoose.js doc, it is able to set setters to a field on schema.
However, the doc is not quite detailed and obselete.
Some example:

The hash will be called mainly on following scenarios:

• When a new doc being created.

• When set a value to a doc.

However, this will not work for update query:

For password, it is able to write beforeUpdateHook