multidatastore
v3.2.0
Published
multiple data store
Downloads
9
Readme
multidatastore
A wrapper around multiple data stores.
- multidatastore
- static
- inner
multidatastore.create(drivers)
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. |
multidatastore.singleton(owner, [options])
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~Multi_Data_Store
multidatastore Interface
Kind: inner interface of multidatastore
Multi_Data_Store.init(drivers)
Initialize the MDS.
Kind: static method of Multi_Data_Store
| Param | Type | Description | | --- | --- | --- | | drivers | Array.<driver> | A an array of datastore drivers. |
Multi_Data_Store.add_driver(driver)
Add a datastore driver to the MDS.
Kind: static method of Multi_Data_Store
| Param | Type | Description | | --- | --- | --- | | driver | driver | A datastore driver. |
Multi_Data_Store.remove_driver(driver)
Removes the given driver from the MDS.
Kind: static method of Multi_Data_Store
| Param | Type | Description | | --- | --- | --- | | driver | driver | A datastore driver. |
Multi_Data_Store.stop()
Stops the MDS, calling .stop() on all drivers.
Kind: static method of Multi_Data_Store
Multi_Data_Store.put(object, [options])
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 |
Multi_Data_Store.get(id, [options], [driver])
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 |
Multi_Data_Store.find(criteria, [options], [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 |
Multi_Data_Store.find_by(criteria, [options], [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 |
Multi_Data_Store.del(id, [options])
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 |
Multi_Data_Store.del_by(criteria, [options], [driver])
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 |