I am fetching data from indexeddb using where class using jsstore.I got response.But getting "Failed to execute 'only' on 'IDBKeyRange': The parameter is not a valid key. " console error.Why I am getting this error.can anyone pls help me.
//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
}
});
}
value of section will be like "India","TamilNadu"
Kindly find the attached screenshot for error
here
I am using jsstore 1.3.0
I updated jsstore version to 1.4.1 which is giving "Maximum call stack size exceeded"
Thanks
It is due to the invalid value supplied. IndexedDB support list of value - numbers, dates, strings, binary data, array : which are valid keys.
This error is generally thrown when you are passing - boolean,null or undefined value.
Check out w3c for more info - https://w3c.github.io/IndexedDB/#key-construct
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With