LearnBoost/mongoose — pull request #655 by chrisleishman (2011-12-17 18:16:53+00:00)
Title: Check for mongoose types rather than toObject

Specifically Document, MongooseArray and MongooseBuffer.

This is an alternative to #646.

Currently it checkes 'instanceof' for all three types in every case where a toObject check previously occurred. This could probably be made neater by having a common base MongooseObject, or some similar technique, but that would be too large a change for this pull request.