KV — 键值存储

class KV(...)

使用示例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# coding=utf-8
# This is a sample Python script.
from driver import KV

print("-------------------start kv test--------------------")
kv = KV()
result = kv.setStorageSync("aiot", "amp")
print(result)
result = kv.getStorageSync("aiot")
print(result)
result = kv.removeStorageSync("aiot")
print(result)
print("-------------------end kv test--------------------")

操作函数

setStorageSync(key, value)

新增/更新 key-value

getStorageSync(key)

读取KV中的值

removeStorageSync(key)

清除key-value值