The interface representing the structure of the documents in the collection.
The type of instance which wraps the documents, generally the subclass of this class.
This class will be subclassed automatically by Iridium to create a model specific instance which takes advantage of some of v8's optimizations to boost performance significantly. The instance returned by the model, and all of this instance's methods, will be of type TInstance - which should represent the merger of TSchema and IInstance for best results.
Creates a new instance which represents the given document as a type of model
The model that dictates the collection the document originated from as well as how validations are performed.
The document which should be wrapped by this instance
The cache director used to derive unique cache keys for documents of this type.
The name of the collection into which documents of this type are stored.
The indexes which should be managed by Iridium for the collection used by this type.
mapReduce Options
A function which is called whenever a new document is in the process of being inserted into the database.
A function which is called whenever a new instance has been created to wrap a document.
A function which is called whenever a document of this type is received from the database, prior to it being wrapped by an Instance object.
A function which is called whenever an instance's save() method is called to allow you to interrogate and/or manipulate the changes which are being made.
The rename map which will be used to map code field names to DB fields
The transformations which should be applied to properties of documents of this type.
Additional which should be made available for use in the schema definition for this instance.
Gets the underlying document representation of this instance
Removes this instance's document from the backing collection
A callback which is triggered when the operation completes
Retrieves the first element in an enumerable collection which matches the predicate
The collection from which to retrieve the element
The function which determines whether to select an element
The first element in the array which matched the predicate.
Retrieves the first element in an enumerable collection which matches the predicate
The collection from which to retrieve the element
The function which determines whether to select an element
The first element in the object which matched the predicate.
Updates this instance to match the latest document available in the backing collection
A callback which is triggered when the update completes
Removes this instance's document from the backing collection
A callback which is triggered when the operation completes
Saves any changes to this instance, using the built in diff algorithm to write the update query.
A callback which is triggered when the save operation completes
Saves the given changes to this instance and updates the instance to match the latest database document.
The MongoDB changes object to be used when updating this instance
A callback which is triggered when the save operation completes
Saves the given changes to this instance and updates the instance to match the latest database document.
The conditions under which the update will take place - these will be merged with an _id query
The MongoDB changes object to be used when updating this instance
A callback which is triggered when the save operation completes
Retrieves a number of elements from an enumerable collection which match the predicate
The collection from which elements will be plucked
The function which determines the elements to be plucked
A new array containing the elements in the array which matched the predicate.
Retrieves a number of elements from an enumerable collection which match the predicate
The collection from which elements will be plucked
The function which determines the elements to be plucked
An object with the properties from the collection which matched the predicate.
Gets the DB representation of this instance
Gets the JSON representation of this instance
Gets a string representation of this instance
Updates this instance to match the latest document available in the backing collection
A callback which is triggered when the update completes
The schema used to validate documents of this type before being stored in the database.
Generated using TypeDoc
The default Iridium Instance implementation which provides methods for saving, refreshing and removing the wrapped document from the collection, as well as integrating with Omnom, our built in document diff processor which allows clean, atomic, document updates to be performed without needing to write the update queries yourself.