@hyperledger/identus-edge-agent-sdk / Exports / Pluto / Store
Interface: Store
Pluto.Store
Implemented by
Table of contents
Methods
Methods
delete
▸ delete(table
, uuid
): Promise
<void
>
Deleting a row in the Store
Parameters
Name | Type |
---|---|
table | string |
uuid | string |
Returns
Promise
<void
>
Defined in
insert
▸ insert<T
>(table
, model
): Promise
<void
>
Persist new data in the Store.
Type parameters
Name | Type |
---|---|
T | extends Storable |
Parameters
Name | Type | Description |
---|---|---|
table | string | table name |
model | T | object to save |
Returns
Promise
<void
>
Defined in
query
▸ query<T
>(table
, query?
): Promise
<T
[]>
Run a query to fetch data from the Store
Type parameters
Name | Type |
---|---|
T | extends Storable |
Parameters
Name | Type | Description |
---|---|---|
table | string | table name |
query? | MangoQuery <T > | a MangoQuery object, a set of values and operators defining the query properties within an object will be AND'ed different objects will be OR'd |
Returns
Promise
<T
[]>
relevant Models
Example
search for a model in TableOne with uuid and name
store.query("TableOne", { selector: { uuid: "1", name: "eg" }})
Example
search for models in TableOne with uuid of 1 or 2
store.query("TableOne", { selector: { $or: [{ uuid: "1" }, { uuid: "2" }] }})
Example
search for all models in TableOne
store.query("TableOne")
Defined in
start
▸ start(): Promise
<void
>
Handle any necessary startup. Will be called first before any usage, if provided.
Returns
Promise
<void
>
Defined in
stop
▸ stop(): Promise
<void
>
Handle any necessary teardown.
Returns
Promise
<void
>
Defined in
update
▸ update<T
>(table
, model
): Promise
<void
>
Updating a new row in the Store
Type parameters
Name | Type |
---|---|
T | extends Storable |
Parameters
Name | Type |
---|---|
table | string |
model | T |
Returns
Promise
<void
>