| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/API/IDBKeyRange | [Back] [Original] |
Get to know MDN better
IDBKeyRange IndexedDB API 1 IDBObjectStore IDBIndex A Z
() () ()
| x | IDBKeyRange.lowerBound(x) |
| > x | IDBKeyRange.lowerBound(x, true) |
| y | IDBKeyRange.upperBound(y) |
| < y | IDBKeyRange.upperBound(y, true) |
| x && y | IDBKeyRange.bound(x, y) |
| > x && < y | IDBKeyRange.bound(x, y, true, true) |
| > x && y | IDBKeyRange.bound(x, y, true, false) |
| x && < y | IDBKeyRange.bound(x, y, false, true) |
| = z | IDBKeyRange.only(z) |
lower
undefinedlowerOpen false upper
undefinedupperOpen false "A" "F" keyRangeValue (IDBTransaction ) IDBObjectStore.openCursor keyRangeValue "A" "F" IDBKeyRange.bound("A", "F", true, true); "A" "F"
: IDBKeyRange-example ()
function displayData() {
const keyRangeValue = IDBKeyRange.bound("A", "F");
const transaction = db.transaction(["fThings"], "readonly");
const objectStore = transaction.objectStore("fThings");
objectStore.openCursor(keyRangeValue).onsuccess = (event) => {
const cursor = event.target.result;
if (cursor) {
const listItem = document.createElement("li");
listItem.textContent = `${cursor.value.fThing}, ${cursor.value.fRating}`;
list.appendChild(listItem);
cursor.continue();
} else {
console.log("");
}
};
}
| Indexed Database API 3.0 # keyrange |
IDBKeyRange| Web Proxy Viewer | New URL | Original Page |