W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

IndexedDB API Doc Correction

From: Jake Drew <jakemdrew@gmail.com>
Date: Tue, 4 Sep 2012 11:51:43 -0500
Message-ID: <CAHk=NoQvXX5vYUxQ-29x1ufTw1F1fpVHOfDRyt2Y0aGSGnOEJA@mail.gmail.com>
To: public-webapps@w3.org
Hello,

I have a quick document correction for:  http://www.w3.org/TR/IndexedDB/

As far as I can tell, there is no "openIndex" method as shown in the "var
index" example below.  I think it should be objectStore.index() ?  Also, I
am assuming that the var vtx is a versionchange transaction object, but vtx
is not defined anywhere else in the documentation.  Just figured I would
pass these along :)

3.3.4 Index

var db = indexedDBSync.open('AddressBook', 2, function(trans, oldVersion) {
  if (oldVersion === 1) {
    trans.db.createObjectStore('Contact', {keyPath:'id', autoIncrement:true});
  }
  var store = vtx.objectStore('Contact');
  store.createIndex('ContactName', {unique:false, multiEntry:false});
});

var index = store.openIndex('ContactName');
var id = index.get('Lincoln');
// id === 1


Thanks,

Jake Drew
www.jakemdrew.com
Received on Tuesday, 4 September 2012 22:09:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:54 GMT