【发布时间】:2018-01-28 09:02:30
【问题描述】:
我正在使用带有索引数据库适配器的 pouchDB 开发 ionic 3/angular 4 应用程序。我的查询是如何使用 ionic 3/angular 4 增加 pouchDB 中的索引 db 大小,因为我的 json 大小为 20mb,我想将其存储在 db 中以供离线应用。
非常感谢任何帮助:)
【问题讨论】:
标签: angular ionic3 indexeddb pouchdb typescript2.0
我正在使用带有索引数据库适配器的 pouchDB 开发 ionic 3/angular 4 应用程序。我的查询是如何使用 ionic 3/angular 4 增加 pouchDB 中的索引 db 大小,因为我的 json 大小为 20mb,我想将其存储在 db 中以供离线应用。
非常感谢任何帮助:)
【问题讨论】:
标签: angular ionic3 indexeddb pouchdb typescript2.0
问题是“pouchdb core”的大小参数的打字稿(类型定义)被遗漏了。 在未来版本更新类型定义文件之前,您可能需要自己添加它
在 index.d.ts (node_modules/@types/pouchdb-core/index.d.ts) 的第 516 行附近,在接口声明中。
来自
interface LocalDatabaseConfiguration extends CommonDatabaseConfiguration {
auto_compaction?: boolean;
revs_limit?: number;
}
到
interface LocalDatabaseConfiguration extends CommonDatabaseConfiguration {
auto_compaction?: boolean;
revs_limit?: number;
size?: number;
}
已经提供了此更改的拉取请求,但到目前为止还没有进入最新版本
【讨论】:
对于 20mb,我认为您可以安全地使用大多数主流浏览器。
【讨论】: