Skip to content
New issue

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

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

Already on GitHub? # to your account

Need help creating complex keys #50

Open
newbie-gk opened this issue Oct 26, 2015 · 1 comment
Open

Need help creating complex keys #50

newbie-gk opened this issue Oct 26, 2015 · 1 comment

Comments

@newbie-gk
Copy link

I'm new to indexedDB and trying to create complex keys as the example below, but it is giving me error

var aStore = db.createObjectStore('aStore', {keyPath: ['a_id', 'b_code']});
a.createIndex('c_idx', {'c' : ['c.d', 'c.f']} , {unique: false});

ERROR
Uncaught SyntaxError: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.(anonymous function) @ app.js:29applyNeededUpgrades @ angular-indexed-db.js:52dbReq.onupgradeneeded @ angular-indexed-db.js:131
angular.js:10627 $indexedDB: myIndexedDB database deleted.

Examples using angular-indexedDB to create/use complex keys are much appreciated

Thanks!

@seanmavley
Copy link

I don't think compound keys are allowed in the keyPath (_id field, if thinking in MongoDB), at least, as per the error.

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

No branches or pull requests

2 participants