import Storage from 'node-collections-boilerplate/node-collections-boilerplate-nahid/storage/Storage.js'
Storage
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(options: StorageOptions) |
Member Summary
Public Members | ||
public |
if there are no efficient way of checking update, make a warning notification once |
|
public |
Name of collection. |
|
public |
Connection string for storage. |
|
public |
lookup: * |
|
public |
primaryKey: * id field of record |
|
public |
timeout: * update check timeout object |
|
public |
Minimum duration between updates in ms |
|
public |
Maximum duration between updates in ms |
|
public |
Rate at which update checks are slowed down when there are no updates. |
Method Summary
Public Methods | ||
public |
async connect() Connect to data storage |
|
public abstract |
async createRecord(record: *) |
|
public abstract |
async deleteRecord(record: *) |
|
public abstract |
async readAllRecords(): Array<Record> |
|
public abstract |
async readRecord(record: *) |
|
public |
Start checking for updates. |
|
public |
Stop checking for updates. |
|
public abstract |
async updateCheckImpl(): * Implmentation of update checking. |
|
public abstract |
async updateRecord(record: *) |
Public Constructors
public constructor(options: StorageOptions) source
Params:
Name | Type | Attribute | Description |
options | StorageOptions | see fields |
Public Members
public bruteForceNotified: boolean source
if there are no efficient way of checking update, make a warning notification once
public collectionName: * source
Name of collection. Derived from connection string if there is # based seperation.
public lookup: * source
Public Methods
public abstract async createRecord(record: *) source
Params:
Name | Type | Attribute | Description |
record | * |
public abstract async deleteRecord(record: *) source
Params:
Name | Type | Attribute | Description |
record | * |
public abstract async readRecord(record: *) source
Params:
Name | Type | Attribute | Description |
record | * |
public startRecordUpdateCheck() source
Start checking for updates. Emit events when there are updates. Required for use with CachedCollection
public stopRecordUpdateCheck() source
Stop checking for updates. Required for use with CachedCollection
public abstract async updateCheckImpl(): * source
Implmentation of update checking.
Override this if storage has more efficient way of checking for updates.
Return:
* |
public abstract async updateRecord(record: *) source
Params:
Name | Type | Attribute | Description |
record | * |