javascript - IndexedDb 列名
问题描述
是否可以从 indexeddb 获取所有列名?或者我如何映射来自 indexeddb 的结果并附加到对象
var data = new FormData();
var myDB = window.indexedDB.open("myDb");
myDB.onsuccess = function () {
this.result.transaction("myTable").objectStore("myTable").getAll().onsuccess = function (event) {
var result = event.target.result;
$.each(result, function (i, tableData) {
// I would like to map all column data and append to an object
data.append("colName","ColValue"); // I would like the column name to be dynamic here instead of hardcode like say if
I have column name like Name, Address I would like to append to object.
});
}
这是我在 indexeddb 中的示例数据的样子
解决方案
推荐阅读
- javascript - 当我编译我的文件时,为什么我不能编译样式文件?
- python-3.x - tiff.imread() 返回什么类型的数组?
- c# - 如何使用 fo-DICOM 替换 DICOM 文件的像素数据?
- asp.net-mvc - 如何使用导航菜单重定向到控制器表单共享布局视图
- php - 无法使用 cron 发送电子邮件?
- c++ - C++不能定义虚函数OUTSIDE类和头文件
- sql - 如何检查ssis中的列结构?
- android - 即使在构建成功后,代码覆盖率报告也显示为 0%
- java - Java - 将 int 转换为 char 的问题
- c# - 有什么办法可以进一步减少代码行数?