This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28456 - nested keyPath: allow specification which part should be iterated if it's an array
Summary: nested keyPath: allow specification which part should be iterated if it's an ...
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-09 22:00 UTC by Timm
Modified: 2015-08-10 20:43 UTC (History)
4 users (show)

See Also:


Attachments

Description Timm 2015-04-09 22:00:24 UTC
In one of our apps I would like to store objects like this:
{ children: [{ id: 'c1' }, { id: 'c1' }] }

I would like to be able to create an index to quickly find all parents for child 'c1'.

Sadly an index like "children.id" { multiEntry: true } does not work here.

I would propose something like "children[].id" { multiEntry: true } to indicate, that the children property should be iterated, not their id field.

Related discussions:
https://social.msdn.microsoft.com/Forums/en-US/dbf2fd2d-a8ca-4228-8a49-3948d44f7e26/indexeddb-and-complex-keypaths-for-index (where Israel Hilerio (MSFT) mentions this should be discussed for IDB v2)
https://github.com/dfahlander/Dexie.js/issues/86
Comment 1 Joshua Bell 2015-08-10 20:43:27 UTC
Moved to https://github.com/w3c/IndexedDB/issues/35