Clones the given document recursively, taking into account complex types like Buffers correctly. Optimized for working with query documents instead of true documents.
Clones the given document recursively, taking into account complex types like Buffers correctly.
Converts the given document to its database form into a form using the transforms defined on the model.
The document to be converted
Whether or not to clone the document before performing any transforms (performance boost)
A new document cloned from the original and transformed
Performs a diff operation between two documents and creates a MongoDB changes object to represent the differences
The original document prior to changes being made
The document after changes were made
Converts the given document from its database form using the transforms defined on the model.
The document to be converted.
The result of having transformed the document.
Converts the given document to its database form into a form using the transforms defined on the model.
The document to be converted
The result of having transformed the document.
Validates a document to ensure that it matches the model's ISchema requirements
The document to validate against the ISchema
The result of the validation
Wraps the given document in an instance wrapper for use throughout the application
The document to be wrapped as an instance
Whether the instance originated from the database or was created by the application
Whether the document supplied contains all information present in the database
An instance which wraps this document
Generated using TypeDoc
A number of helper methods used commonly within Iridium, they provide a means to transform, validate, wrap and diff instances and documents. By keeping these methods in one place we help to improve testability and reduce code duplication (mouse abuse) throughout the codebase.