Created
May 11, 2010 14:59
-
-
Save dalmaer/397409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = indexedDB.open('books', 'Book store', false); | |
if (db.version !== '1.0') { | |
var olddb = indexedDB.open('books', 'Book store'); | |
olddb.createObjectStore('books', 'isbn'); | |
olddb.createIndex('BookAuthor', 'books', 'author', false); | |
olddb.setVersion("1.0"); | |
} | |
// db.version === "1.0"; | |
var index = db.openIndex('BookAuthor'); | |
var matching = index.get('fred'); | |
if (matching) | |
report(matching.isbn, matching.name, matching.author); | |
else | |
report(null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment