我正在使用jsstore的where类从indexeddb中提取数据。我已经获得了响应,但是控制台报错显示:“Failed to execute 'only' on 'IDBKeyRange': The parameter is not a valid key.”。为什么会出现这个错误?请问有谁能帮助我解决这个问题。
//Get DBSchema(table & columns)
private getDbSchema = function () {
const tblArticle = {
Name: this._indexedDBLiveDBTableName,
Columns: [
{
Name: 'ParentName',
NotNull: true,
DataType: 'string'
},
{
Name: 'ChildName',
NotNull: true,
DataType: 'string'
}
,
{
Name: 'UpdatedDate',
NotNull: true,
DataType: 'string'
}
]
};
const Database = {
Name: this._indexedDBLiveDBName,
Tables: [tblArticle]
};
return Database as any;
};
//Fetch articles From IndexedDB
GetArticleFromIndexedDb(section) {
this._connection.openDb(this._indexedDBLiveDBName);
return this._connection.select({
From: this._indexedDBLiveDBTableName,
Where: {
ChildName: section
}
});
}
区域值将类似于“印度”,“泰米尔纳德邦”
请查看附加的截图以获取错误信息
我正在使用 jsstore 1.3.0
我将 jsstore 版本更新为 1.4.1,但出现了“超出最大调用栈大小”的问题
谢谢
IDBKeyRange.only()
函数?正如错误提示所述,你只能传递有效的 Indexed DB 键值(数字、日期、字符串、二进制数据或其他键值的数组)。 - Joshua Bell