GraphStoreMemory
API > [GraphStoreMemory Module] > GraphStoreMemory
Class
The implementation of a persistent graph store that uses a JSON object in memory
Hierarchy
↳ GraphStoreMemory
Implements
Constructors
Properties
Methods
Constructors
any
): GraphStoreMemory
⊕ new GraphStoreMemory(initialState: Overrides GraphStore.constructor
Defined in GraphStoreMemory.ts:15
constructor
Parameters:
Param | Type | Description |
---|---|---|
initialState | any | The initial JSON object to use as the store data |
Returns: GraphStoreMemory
Properties
db
● db: IFireDatabase
Inherited from GraphStore.db
Defined in GraphStore.ts:41
Methods
observeCollection
► observeCollection(keys: any
, path: string
, primaryKeys: string
[], modelCollection: IObservableArray
.<any
>, modelType: any
): function
Implementation of IGraphStore.observeCollection
Inherited from GraphStore.observeCollection
Defined in GraphStore.ts:110
Get a collection of database documents (rows) that match a partial primary key set
Parameters:
Param | Type | Description |
---|---|---|
keys | any | Primary keys to be searched for |
path | string | Database path of documents (usually based on keys) |
primaryKeys | string [] | Simple list of all primary key names for the expected model |
modelCollection | IObservableArray .<any > | Observable array to update with the collection and its additions, deletions, and changes over time |
modelType | any | constructor to use when adding items to this modelCollection |
Returns: function
unsubscribe disposer function
observeDocument
► observeDocument(keys: any
, path: string
, primaryKeys: string
[], model: any
): function
Implementation of IGraphStore.observeDocument
Inherited from GraphStore.observeDocument
Defined in GraphStore.ts:61
Get a given database document (row)
Parameters:
Param | Type | Description |
---|---|---|
keys | any | Primary keys to be searched for |
path | string | Database path of document (usually based on keys) |
primaryKeys | string [] | Simple list of all primary key names for the expected model |
model | any | observable object to update with selected document |
Returns: function
unsubscribe disposer function
updateDocument
► updateDocument(path: string
, primaryKeys: string
[], update_value: any
, status: IGraphStoreStatus, deleted: boolean
): void
Implementation of IGraphStore.updateDocument
Inherited from GraphStore.updateDocument
Defined in GraphStore.ts:175
Update or delete the database at the given path
Parameters:
Param | Type | Description |
---|---|---|
path | string | Database path of document |
primaryKeys | string [] | Simple list of all primary key names for the expected model |
update_value | any | Value including keys to update |
status | IGraphStoreStatus | Status object on which interim status is returned |
deleted | boolean | true if the record is to be deleted, false if its to be updated |
Returns: void