#鸿蒙学习大百科#如何向键值型数据库中插入数据?

如何向键值型数据库中插入数据?

HarmonyOS
2024-10-23 11:22:37
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
耗子煨汁r
try {
  kvStore.put("name", "张三", (err) => {
    if (err !== undefined) {
      console.error(`Failed to put data. Code:${err.code},message:${err.message}`);
      return;
    }
    console.info('Succeeded in putting data.');
  });
} catch (e) {
  let error = e as BusinessError;
  console.error(`An unexpected error occurred. Code:${error.code},message:${error.message}`);
}
分享
微博
QQ
微信
回复
2024-10-23 17:11:25
相关问题