Created
July 7, 2021 18:37
-
-
Save Akifcan/7d6a5903e48be1e3bac68f9cffb91a11 to your computer and use it in GitHub Desktop.
where with index
This file contains hidden or 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 request = window.indexedDB.open("photos", 1); | |
request.onsuccess = function (event) { | |
var db = event.target.result; | |
var objectStore = db.transaction("photos").objectStore("photos"); | |
var index = objectStore.index("name"); | |
//index üzerinden sorgumuzu çalıştıracağımız keyimizi belirtiyoruz. | |
index.get("kitten cat").onsuccess = function (event) { | |
console.log(event.target.result); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment