W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: [IndexedDB] Behavior of IDBObjectStore.get() and IDBObjectStore.delete() when record doesn't exist

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 8 Nov 2010 11:35:15 -0800
Message-ID: <AANLkTim_HMPfgi-55LPQqF-1v7V3ny_SCj6-aozotM00@mail.gmail.com>
To: Keean Schupke <keean@fry-it.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Webapps WG <public-webapps@w3.org>
On Monday, November 8, 2010, Keean Schupke <keean@fry-it.com> wrote:
> Hi,
> Indeed. But I think this is more unexpected and confusing than having
> .get() return the same thing if the entry exists as if it contains
> undefined.
> / Jonas
> I don't understand that.
> with the proposal, undefined clearly means the entry does not exist as there is no way to put an undefined into the object store (as .put(undefined, key) deletes the entry).

The confusing part is that a function called 'put' actually deletes
something, especially since we also have a 'delete' function.

I would put the question this way: What problem are you trying to
solve? If the problem is that people can't store "undefined" and then
tell "undefined" apart from "not there" then your proposal doesn't
solve that problem as "undefined" can't be stored at all.

Additionally, as was mentioned, you can still tell "undefined" from
"not there" by using a cursor.

/ Jonas
Received on Monday, 8 November 2010 19:36:05 UTC

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