Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetByIndex returning Undefined #72

Open
Maverik005 opened this issue May 6, 2020 · 0 comments
Open

GetByIndex returning Undefined #72

Maverik005 opened this issue May 6, 2020 · 0 comments

Comments

@Maverik005
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant