new DatabaseManager(options)
Class representing a database manager.
Name | Type | Description |
---|---|---|
options |
DatabaseManagerOptions | The DatabaseManagerOptions. |
- Source:
Methods
(async, abstract) add(type, data) → {Promise.<any>}
Add a new DatabaseObject.
Name | Type | Description |
---|---|---|
type |
string | The type of DatabaseObject to add. |
data |
any | The raw data for the new DatabaseObject. |
- Source:
The new DatabaseObject (should not need to be saved).
- Type
- Promise.<any>
(async, abstract) delete(object) → {Promise.<void>}
Delete a DatabaseObject.
Name | Type | Description |
---|---|---|
object |
DatabaseObject | The DatabaseObject to delete. |
- Source:
- Type
- Promise.<void>
(async, abstract) find(query) → {Promise.<Array.<any>>}
Execute a DatabaseQuery.
Name | Type | Description |
---|---|---|
query |
DatabaseQuery | The DatabaseQuery to execute. |
- Source:
The raw data of the DatabaseObject(s).
- Type
- Promise.<Array.<any>>
(async, abstract) get(query) → {Promise.<any>}
Execute a DatabaseQuery that can only return a single unique DataObject.
Name | Type | Description |
---|---|---|
query |
DatabaseQuery | The DatabaseQuery to execute. |
- Source:
The raw data of the DatabaseObject.
- Type
- Promise.<any>
newObject(type, data, isNewopt) → {DatabaseObject}
Create a new DatabaseObject.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string | The type of DatabaseObject to create. |
||
data |
any | The data to initialize the DataObject with. |
||
isNew |
boolean |
<optional> |
true | Whether or not the DatabaseObject should be treated as a new record. |
- Source:
The new DatabaseObject.
- Type
- DatabaseObject
newQuery(type) → {DatabaseQuery}
Start a DatabaseQuery.
Name | Type | Description |
---|---|---|
type |
string | The type of DatabaseObject to query for. |
- Source:
The new DatabaseQuery.
- Type
- DatabaseQuery
(async, abstract) update(object) → {Promise.<any>}
Update a Database Object.
Name | Type | Description |
---|---|---|
object |
DatabaseObject | The DatabaseObject to update. |
- Source:
The raw data of the DatabaseObject.
- Type
- Promise.<any>