Key Value Store

const { kvs } = MODULES;

Schemas

KeyValueStoreValue

Type: Object

Properties

KeyValueStoreRet

Type: Object<string, KeyValueStoreValue>

Methods

get

Craft Key-Value Storeから値を取得する

Parameters

Returns Promise<KeyValueStoreRet>

write

Craft Key-Value Storeに値を書き込む

Parameters

  • param object

    • param.key string 書き込むkey
    • param.value string 書き込むvalue
    • param.minutesToExpire number? 値の有効期限(分)

Returns Promise<object> empty object

checkAndWrite

Craft Key-Value Storeにチェックに合致した値を書き込む

Parameters

  • param object

    • param.key string 書き込むkey
    • param.value string 書き込むvalue
    • param.operator string < > = <= >=のいずれか
    • param.unixtimeMs number 比較対象のunixtime(ms)
    • param.minutesToExpire number? 値の有効期限(分)

Returns Promise<object> empty object

delete

Craft Key-Value Storeから値を削除する

Parameters

Returns Promise<object> empty object