Re: [indexeddb] Do we need to support keyPaths with an empty string?

Mozilla is fine with removing the special |keyPath:""| behavior.
Please note that this will also mean that step 1 of the algorithm here

  http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#dfn-steps-for-extracting-a-key-from-a-value-using-a-key-path

will need to change.

We do want to continue to allow set behavior without specifying the
key twice, though, so we would propose adding an additional option to
createObjectStore to accomplish this:

  // Old way:
  var set = db.createObjectStore("mySet", { keyPath:"" });
  set.put(keyValue);

  // New way:
  var set = db.createObjectStore("mySet", { isSet: true });
  set.put(keyValue);

(We are not in love with "isSet", better names are highly encouraged!)

What do you all think? This would allow us to continue to support nice
set behavior without making the empty string "magic".

-Ben

Received on Friday, 20 January 2012 20:24:10 UTC