Constructor
new DbIndex(database, mapFun)
Represents an DbIndex for a Fireproof database.
Parameters:
Name | Type | Description |
---|---|---|
database | Fireproof | The Fireproof database instance to DbIndex. |
mapFun | function | The map function to apply to each entry in the database. |
- Source
Methods
(async) query(query) → {Promise.<{rows: Array.<{id: string, key: string, value: any}>}>}
Query object can have {range}
Parameters:
Name | Type | Description |
---|---|---|
query | DbQuery | the query range to use |
- Source
Returns:
- Type:
- Promise.<{rows: Array.<{id: string, key: string, value: any}>}>
Type Definitions
ChangeEvent
JDoc for the result row type.
Type:
Properties- Object
Name | Type | Attributes | Description |
---|---|---|---|
key | string | The key of the document. | |
value | Object | The new value of the document. | |
del | boolean | <optional> | Is the row deleted? |
- Source
DbIndexEntry
JDoc for the result row type.
Type:
Properties- Object
Name | Type | Attributes | Description |
---|---|---|---|
key | Array.<string> | The key for the DbIndex entry. | |
value | Object | The value of the document. | |
del | boolean | <optional> | Is the row deleted? |
- Source
DbQuery
JSDoc for Query type.
Type:
Properties- Object
Name | Type | Attributes | Description |
---|---|---|---|
range | Array.<string> | <optional> | The range to query. |
- Source