Re: [indexeddb] IDBIndex.getKey incorrect description.

2011-06-16 Thread Jonas Sicking
On Tue, Jun 14, 2011 at 9:00 AM, Israel Hilerio  wrote:
> The description for the IDBIndex.getKey tells us to use “the steps for
>
> retrieving a value from an index" as the operation.  These steps seem to
> deal
>
> with how to retrieve values and not keys.  It seems, we need a new section
>
> similar to this one that explains how to retrieve a primary key from an
> index.
>
> The main issue we are having is knowing what to return when there are no
>
> records that match the "key" parameter.  For example, imagine that we
>
> create an index on an empty object store and immediately call getKey.  We
>
> believe that this should call the onsuccess handler with a result set to
>
> undefined.  This seems to match the spirit of the note under
>
> IDBIndex.getKey.
>
> I believe this will also affect the IDBIndexSync.getKey.
>
> Do you agree?

I *think* things are correct as they are since the 'value' field of
the records in an index contains keys for the object store. Compare to
the "steps for retrieving a referenced value from an index" algorithm
used by IDBIndex.get().

/ Jonas



[indexeddb] IDBIndex.getKey incorrect description.

2011-06-14 Thread Israel Hilerio
The description for the IDBIndex.getKey tells us to use "the steps for

retrieving a value from an index" as the operation.  These steps seem to deal

with how to retrieve values and not keys.  It seems, we need a new section

similar to this one that explains how to retrieve a primary key from an index.

The main issue we are having is knowing what to return when there are no

records that match the "key" parameter.  For example, imagine that we

create an index on an empty object store and immediately call getKey.  We

believe that this should call the onsuccess handler with a result set to

undefined.  This seems to match the spirit of the note under

IDBIndex.getKey.

I believe this will also affect the IDBIndexSync.getKey.

Do you agree?



Israel