[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/API/IDBKeyRange [Back]  [Original]

IDBKeyRange - Web API | MDN

MDN Web Docs

View in English Always switch to English

IDBKeyRange

Baseline

20157

:

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

    • undefined
    • lowerOpen false
  • upper

    • undefined
    • upperOpen false

IDBKeyRange.lower

IDBKeyRange.upper

IDBKeyRange.lowerOpen

false

IDBKeyRange.upperOpen

false

IDBKeyRange.bound()

IDBKeyRange.only()

IDBKeyRange.lowerBound()

IDBKeyRange.upperBound()

IDBKeyRange.includes()

Boolean

"A" "F" keyRangeValue (IDBTransaction ) IDBObjectStore.openCursor keyRangeValue "A" "F" IDBKeyRange.bound("A", "F", true, true); "A" "F"

js
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


Web Proxy Viewer  |  New URL  |  Original Page