LearnBoost/mongoose — pull request #1160 by olalonde (2012-10-16 18:42:39+00:00)
Title: Implemented a way to hide fields by default when calling toJSON on a document

Following this issue (https://github.com/LearnBoost/mongoose/issues/1020), I have implemented a way to disable fields by default on toJSON.

For example:

userSchema.set('toJSON', {hide: 'password salt'});

Look at the commits for documentation , usage examples and tests. Hope this will get merged!