W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

[Bug 15796] New: Specify how to extract a key when keyPath is an array

From: <bugzilla@jessica.w3.org>
Date: Mon, 30 Jan 2012 19:39:02 +0000
To: public-webapps@w3.org
Message-ID: <bug-15796-2927@http.www.w3.org/Bugs/Public/>

           Summary: Specify how to extract a key when keyPath is an array
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Indexed Database API
        AssignedTo: dave.null@w3.org
        ReportedBy: odinho@opera.com
         QAContact: member-webapi-cvs@w3.org
                CC: mike@w3.org, public-webapps@w3.org

createObjectStore allows us to get a keyPath that is an array[1].

But there is as far as I can tell a lack of explicit mention of the possibility
of the keyPath being an array later.

Does it belong in the steps for extracting a key path from a value? [2] Or
possibly more fitting, a step up in the hierarchy like the steps for storing a
record into and object store.

Anyway, keyPath as Array seems to be well specified for Indexes, both in
IDBObjectStore.add [3] and in the steps for storing a record into an object
store [4], but not so for keys, AFAICS.

Maybe change step 1 in "steps for storing a record into an object store" from:

> 1. If store does use in-line keys and evaluting store's key path on value
>    does yield a value, then set key to that result.


> 1. If store uses in-line keys and the store's key path is an [Array]
>    then set /tempkey/ to a newly created empty Array. For each item in 
>    the key path [evaluate] the item on value. If this does not yield a
>    value continue to next step. Otherwise add the value to the end of 
>    /tempkey/. When the array is finished set /key/ to /tempkey/.
> 2. Else if store does use in-line keys and evaluating store's key path 
>    on value yields a value, then set key to that result.

Possibly changed to clearer and more succinct language :P


Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Monday, 30 January 2012 19:39:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:31 UTC