LearnBoost/mongoose — pull request #2125 by WarttHog (2014-06-05 04:50:51+00:00)
Title: Support for "Extended JSON" dates

When importing JSON, there needs to be some way to specify Date-type data. The MongoDB team decided to allow dates to be represented in the form:

"myDateField": { "$date": }

http://docs.mongodb.org/manual/reference/mongodb-extended-json/#date

This PR looks for the above form in Document.prototype.set() which allows data imported via Model.create() to include date data.

Note: I haven't added any tests for this functionality. In fact, I didn't even run the tests. I don't feel like trying to get make to run on my Windows box right now. It might be an idea someday to switch to a test framework that could be entirely installed via npm.