如何更新索引DB中的数组值?我不想覆盖整个阵列,而是要加入一个新数组
我正在使用索引DB存储以下类型的键值对。
键 - 字符串(类型)
值 - 阵列(类型),
例如
索引表
键值 | num |
---|---|
strong | [1,2,3] |
我需要更新“ nums”
array,而无需 覆盖直接索引db中的数组。
我想将新项目[4,5]
推向此nums
数组,例如使用push> push
javaScript中的函数。
,表格应像:
键值 | 推动操作后 |
---|---|
数字 | [1,2,3,4,5] |
I am using indexed DB to store key-value pairs of the below type.
Key - String (type)
Value - Array (type)
e.g.
Indexed Table
Key | Value |
---|---|
nums | [1,2,3] |
I need to update the "nums"
array without overwriting the array in indexed DB directly.
I want to push new items [4,5]
to this nums
array like using push
function in JavaScript.
After this push operation, table should look like:
Key | Value |
---|---|
nums | [1,2,3,4,5] |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论