-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Here is my openDatabase
openDatabase(tableName: string,tableColumns: string[], indexedDBObj: AngularIndexedDB){ //Create DB Version 1 indexedDBObj.openDatabase(indexedDBObj.dbWrapper.dbVersion, (evt) => { let objectStore = evt.currentTarget.result.createObjectStore(tableName, { keyPath: "Id", autoIncrement: true }); tableColumns.forEach(col => { objectStore.createIndex(col, col, { unique: false }); }); }) }
Keypath:"Id" and I am creating index on every property of the object
Then I am trying to getByIndex like this:
indexedDBSelectByIndex(tableName:string, indexName:string, key:string,indexedDBObj: AngularIndexedDB ){ return indexedDBObj.getByIndex(tableName, indexName, key); }
I am passing indexName as "UsedInRuleItemId",key as the value of the index, and storeName is tableName. It still retuning me undefined value. Ideally it should return the object that contains the value of the index I am passing to it.