modella/mongo — pull request #14 by paulbdavis (2014-07-10 17:45:41+00:00)
Title: add detection for toMongo method

First tried to detect method `model#toMongo()` to get the document used
for saving. This allows `model#toJSON()` to be overridden to hide
hidden/unneeded fields without messing up the database document
structure.

`model#toJSON()` is used as the fallback if the model prototype does not
have a `toMongo()` method.