A wrapper around multiple data stores.
- multidatastore
- static
- inner
Creates an MDS instance.
Kind: static method of multidatastore
Summary: Creates an MDS instance.
Param | Type | Description |
---|---|---|
drivers | Array.<driver> |
The initial MDS drivers to initialize with. |
Creates a singleton MDS based on an owner. Useful for ensuring only one instance is created when accessing from multiple places in your code.
Kind: static method of multidatastore
Summary: Creates a singleton MDS instance.
Param | Type | Description |
---|---|---|
owner | object |
The owning object. |
[options] | object |
creation options |
multidatastore Interface
Kind: inner interface of multidatastore
Initialize the MDS.
Kind: static method of Multi_Data_Store
Param | Type | Description |
---|---|---|
drivers | Array.<driver> |
A an array of datastore drivers. |
Add a datastore driver to the MDS.
Kind: static method of Multi_Data_Store
Param | Type | Description |
---|---|---|
driver | driver |
A datastore driver. |
Removes the given driver from the MDS.
Kind: static method of Multi_Data_Store
Param | Type | Description |
---|---|---|
driver | driver |
A datastore driver. |
Stops the MDS, calling .stop() on all drivers.
Kind: static method of Multi_Data_Store
Put an object into the MDS.
Kind: static method of Multi_Data_Store
Param | Type | Description |
---|---|---|
object | object |
The object to store. |
[options] | object |
storage options |
Get an object from the MDS.
Kind: static method of Multi_Data_Store
Param | Type | Description |
---|---|---|
id | string |
The object id. |
[options] | object |
storage options |
[driver] | driver |
optionally get from a specific datastore driver |
Searches the MDS for an object based on specified criteria. Iterates through the available drivers looking for one that supports the .find() method.
Kind: static method of Multi_Data_Store
Summary: Find an object in the MDS.
Param | Type | Description |
---|---|---|
criteria | object |
An object containing search criteria. |
[options] | object |
search options |
[driver] | driver |
optionally search a specific datastore driver |
Searches the MDS for an object based on a particular field. Iterates through the available drivers looking for one that supports the .find_by() method. This is useful for datastores that support special query indexing on a per-field basis.
Kind: static method of Multi_Data_Store
Summary: Find an object in the MDS using a specific field.
Param | Type | Description |
---|---|---|
criteria | object |
An object containing search criteria. |
[options] | object |
search options |
[driver] | driver |
optionally search a specific datastore driver |
Deletes an object from the MDS.
Kind: static method of Multi_Data_Store
Summary: Delete an object in the MDS.
Param | Type | Description |
---|---|---|
id | string |
The object id. |
[options] | object |
deletion options |
Deletes from the MDS based on specified critera. Iterates through the available drivers looking for one that supports the .del_by() method. This is useful for datastores that support special query indexing on a per-field basis.
Kind: static method of Multi_Data_Store
Summary: Delete obect(s) from the MDS based on given criteria.
Param | Type | Description |
---|---|---|
criteria | object |
An object containing search criteria. |
[options] | object |
search options |
[driver] | driver |
optionally search a specific datastore driver |