The interface used to determine the schema of documents in the collection.
The interface or class used to represent collection documents in the JS world.
Creates a new Iridium model representing a given ISchema and backed by a collection whose name is specified
The Iridium core that this model should use for database access
The class which will be instantiated for each document retrieved from the database
Gets the constructor responsible for creating instances for this model
Gets the cache responsible for storing objects for quick retrieval under certain conditions
Gets the cache controller which dictates which queries will be cached, and under which key
Gets the underlying MongoDB collection from which this model's documents are retrieved. You can make use of this object if you require any low level access to the MongoDB collection, however we recommend you make use of the Iridium methods whereever possible, as we cannot guarantee the accuracy of the type definitions for the underlying MongoDB driver.
Gets the name of the underlying MongoDB collection from which this model's documents are retrieved
Sets the name of the underlying MongoDB collection from which this model's documents are retrieved
Gets the Iridium core that this model is associated with.
The Iridium core that this model is bound to
Provides helper methods used by Iridium for hook delegation and common processes
A set of helper methods which perform common event and response handling tasks within Iridium.
Provides helper methods used by Iridium for common tasks
A set of helper methods which are used within Iridium for common tasks
Gets the even hooks subscribed on this model for a number of different state changes. These hooks are primarily intended to allow lifecycle manipulation logic to be added in the user's model definition, allowing tasks such as the setting of default values or automatic client-side joins to take place.
Gets the indexes which Iridium will manage on this model's database collection.
Gets the renamed fields for this model, which will result in the field names used in your code being different to those used in the database.
Gets the schema dictating the data structure represented by this model. The schema is used by skmatc to validate documents before saving to the database, however until MongoDB 3.1 becomes widely available (with server side validation support) we are limited in our ability to validate certain types of updates. As such, these validations act more as a data-integrity check than anything else, unless you purely make use of Omnom updates within instances.
The defined validation schema for this model
Gets the transforms which are applied whenever a document is received from the database, or prior to storing a document in the database. Tasks such as converting an ObjectID to a string and vice versa are all listed in this object.
Gets the custom validation types available for this model. These validators are added to the default skmatc validators, as well as those available through plugins, for use when checking your instances.
Runs an aggregate operation in MongoDB and returns the contents of the resulting aggregation
The list of aggregation pipeline stages to be executed for this aggregation
A promise which completes with the results of the aggregation task
Counts the number of documents in the collection
A callback which is triggered when the operation completes
Counts the number of documents in the collection which match the conditions provided
The conditions which determine whether an object is counted or not
A callback which is triggered when the operation completes
Inserts an object into the collection after validating it against this model's schema
The object to insert into the collection
A callback which is triggered when the operation completes
Inserts an object into the collection after validating it against this model's schema
The object to insert into the collection
The options dictating how this function behaves
A callback which is triggered when the operation completes
Inserts the objects into the collection after validating them against this model's schema
The objects to insert into the collection
A callback which is triggered when the operation completes
Inserts the objects into the collection after validating them against this model's schema
The objects to insert into the collection
The options dictating how this function behaves
A callback which is triggered when the operation completes
Drops the index with the specified name if it exists in the collection
The name of the index to remove
A callback which is triggered when the operation completes
Whether the index was dropped
Drops the index if it exists in the collection
The index to remove
A callback which is triggered when the operation completes
Whether the index was dropped
Removes all indexes (except for _id) from the collection
A callback which is triggered when the operation completes
Whether the indexes were dropped
Ensures that the given index is created for the collection
The index specification object used by MongoDB
A callback which is triggered when the operation completes
The name of the index
Ensures that the given index is created for the collection
The index specification object used by MongoDB
The options dictating how the index is created and behaves
A callback which is triggered when the operation completes
The name of the index
Ensures that all indexes defined in the model's options are created
A callback which is triggered when the operation completes
The names of the indexes
Retrieves all documents in the collection and wraps them as instances
Returns all documents in the collection which match the conditions and wraps them as instances
The MongoDB query dictating which documents to return
Returns all documents in the collection which match the conditions
The MongoDB query dictating which documents to return
The fields to include or exclude from the document
Retrieves a single document from the collection and wraps it as an instance
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection with the given ID and wraps it as an instance
The document's unique _id field value in downstream format
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection which matches the conditions
The MongoDB query dictating which document to return
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection with the given ID and wraps it as an instance
The document's unique _id field value in downstream format
The options dictating how this function behaves
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection which matches the conditions
The MongoDB query dictating which document to return
The options dictating how this function behaves
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection and wraps it as an instance
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection with the given ID and wraps it as an instance
The document's unique _id field value in downstream format
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection which matches the conditions
The MongoDB query dictating which document to return
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection with the given ID and wraps it as an instance
The document's unique _id field value in downstream format
The options dictating how this function behaves
An optional callback which will be triggered when a result is available
Retrieves a single document from the collection which matches the conditions
The MongoDB query dictating which document to return
The options dictating how this function behaves
An optional callback which will be triggered when a result is available
Inserts an object into the collection after validating it against this model's schema
The object to insert into the collection
A callback which is triggered when the operation completes
Inserts an object into the collection after validating it against this model's schema
The object to insert into the collection
The options dictating how this function behaves
A callback which is triggered when the operation completes
Inserts the objects into the collection after validating them against this model's schema
The objects to insert into the collection
A callback which is triggered when the operation completes
Inserts the objects into the collection after validating them against this model's schema
The objects to insert into the collection
The options dictating how this function behaves
A callback which is triggered when the operation completes
Loads any externally available properties (generally accessed using public getters/setters).
Loads any internally (protected/private) properties and helpers only used within Iridium itself.
Runs a mapReduce operation in MongoDB and returns the contents of the resulting collection.
The mapReduce functions which will be passed to MongoDB to complete the operation.
Options used to configure how MongoDB runs the mapReduce operation on your collection.
A promise which completes when the mapReduce operation has written its results to the provided collection.
Runs a mapReduce operation in MongoDB and writes the results to a collection.
An Iridium.Instance type whichThe mapReduce functions which will be passed to MongoDB to complete the operation.
Options used to configure how MongoDB runs the mapReduce operation on your collection.
A promise which completes when the mapReduce operation has written its results to the provided collection.
Process any callbacks and plugin delegation for the creation of this model. It will generally be called whenever a new Iridium Core is created, however is more specifically tied to the lifespan of the models themselves.
Removes all documents from the collection
A callback which is triggered when the operation completes
Removes all documents from the collection which match the conditions
The conditions determining whether an object is removed or not
A callback which is triggered when the operation completes
Removes all documents from the collection which match the conditions
The conditions determining whether an object is removed or not
The options controlling the way in which the function behaves
A callback which is triggered when the operation completes
Updates the documents in the backing collection which match the conditions using the given update instructions
The conditions which determine which documents will be updated
The changes to make to the documents
A callback which is triggered when the operation completes
Updates the documents in the backing collection which match the conditions using the given update instructions
The conditions which determine which documents will be updated
The replacement document to do a full update
A callback which is triggered when the operation completes
Updates the documents in the backing collection which match the conditions using the given update instructions
The conditions which determine which documents will be updated
The changes to make to the documents
The options which dictate how this function behaves
A callback which is triggered when the operation completes
Updates the documents in the backing collection which match the conditions using the given update instructions
The conditions which determine which documents will be updated
The replacement document to do a full update
The options which dictate how this function behaves
A callback which is triggered when the operation completes
Generated using TypeDoc
An Iridium Model which represents a structured MongoDB collection. Models expose the methods you will generally use to query those collections, and ensure that the results of those queries are returned as {TInstance} instances.