Class: SimpleKVStore
Hierarchy
↳
SimpleKVStore
Constructors
constructor
• new SimpleKVStore(data?
)
Parameters
Name | Type |
---|---|
data? | DataType |
Overrides
Defined in
storage/kvStore/SimpleKVStore.ts:14
Properties
data
• Private
data: DataType
Defined in
storage/kvStore/SimpleKVStore.ts:10
fs
• Private
fs: undefined
| GenericFileSystem
Defined in
storage/kvStore/SimpleKVStore.ts:12
persistPath
• Private
persistPath: undefined
| string
Defined in
storage/kvStore/SimpleKVStore.ts:11
Methods
delete
▸ delete(key
, collection?
): Promise
<boolean
>
Parameters
Name | Type | Default value |
---|---|---|
key | string | undefined |
collection | string | DEFAULT_COLLECTION |
Returns
Promise
<boolean
>
Overrides
Defined in
storage/kvStore/SimpleKVStore.ts:52
get
▸ get(key
, collection?
): Promise
<any
>
Parameters
Name | Type | Default value |
---|---|---|
key | string | undefined |
collection | string | DEFAULT_COLLECTION |
Returns
Promise
<any
>
Overrides
Defined in
storage/kvStore/SimpleKVStore.ts:34
getAll
▸ getAll(collection?
): Promise
<DataType
>
Parameters
Name | Type | Default value |
---|---|---|
collection | string | DEFAULT_COLLECTION |
Returns
Promise
<DataType
>
Overrides
Defined in
storage/kvStore/SimpleKVStore.ts:48
persist
▸ persist(persistPath
, fs?
): Promise
<void
>
Parameters
Name | Type |
---|---|
persistPath | string |
fs? | GenericFileSystem |
Returns
Promise
<void
>
Defined in
storage/kvStore/SimpleKVStore.ts:63
put
▸ put(key
, val
, collection?
): Promise
<void
>
Parameters
Name | Type | Default value |
---|---|---|
key | string | undefined |
val | any | undefined |
collection | string | DEFAULT_COLLECTION |
Returns
Promise
<void
>
Overrides
Defined in
storage/kvStore/SimpleKVStore.ts:19
toDict
▸ toDict(): DataType
Returns
DataType
Defined in
storage/kvStore/SimpleKVStore.ts:99
fromDict
▸ Static
fromDict(saveDict
): SimpleKVStore
Parameters
Name | Type |
---|---|
saveDict | DataType |
Returns
Defined in
storage/kvStore/SimpleKVStore.ts:103
fromPersistPath
▸ Static
fromPersistPath(persistPath
, fs?
): Promise
<SimpleKVStore
>
Parameters
Name | Type |
---|---|
persistPath | string |
fs? | GenericFileSystem |
Returns
Promise
<SimpleKVStore
>