Skip to content

Commit

Permalink
document caveat on getters regarding Model.update()
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmarvin authored and aheckmann committed Mar 26, 2012
1 parent 66d8d15 commit 393e5cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/getters-setters.md
Expand Up @@ -47,6 +47,9 @@ Suppose you are storing credit card numbers and you want to hide everything exce
console.log(found.creditCardNumber); // '****-****-****-1234' console.log(found.creditCardNumber); // '****-****-****-1234'
}); });



**Important!** Note that getters only works when creating or modifying `Document` instances; it will not be invoked when `Document` instances are not involved like in `Model.update()`.

## Summary ## Summary


Setters are intended to modify the underlying raw data. Getters are intended to transform (but not modify at the raw data level) the underlying raw data into something that the user expects to see. They are both defined in the `Schema` definition. Setters are intended to modify the underlying raw data. Getters are intended to transform (but not modify at the raw data level) the underlying raw data into something that the user expects to see. They are both defined in the `Schema` definition.

0 comments on commit 393e5cf

Please sign in to comment.