HTTP/2 302
x-cloud-trace-context: 78b13242ca5e83d015aef8ebfdfcd50a
location: /en-US/docs/Web/API/IDBKeyRange/upperBound
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish, 1.1 varnish
accept-ranges: bytes
cache-control: no-store
server: Google Frontend
content-type: text/plain; charset=utf-8
date: Mon, 29 Dec 2025 16:13:45 GMT
x-served-by: cache-bfi-kbfi7400045-BFI, cache-bfi-kbfi7400045-BFI, cache-sin-wsss1830046-SIN, cache-bom-vanm7210091-BOM
x-cache: MISS, MISS, MISS, MISS
x-cache-hits: 0, 0, 0, 0
x-timer: S1767024825.910758,VS0,VE335
vary: Accept
content-length: 64
HTTP/2 301
content-type: text/plain; charset=utf-8
location: /en-US/docs/Web/API/IDBKeyRange/upperBound_static
server: Google Frontend
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish
x-cloud-trace-context: 037eeb0a8fe112601d357679a05483e6
cache-control: max-age=2592000,public
accept-ranges: bytes
age: 309008
date: Mon, 29 Dec 2025 16:13:45 GMT
x-served-by: cache-sin-wsss1830079-SIN, cache-sin-wsss1830066-SIN, cache-bom-vanm7210091-BOM
x-cache: MISS, HIT, MISS
x-cache-hits: 0, 1, 0
x-timer: S1767024825.268181,VS0,VE53
vary: Accept
content-length: 83
HTTP/2 200
x-goog-stored-content-length: 144427
x-goog-metageneration: 1
referrer-policy: strict-origin-when-cross-origin
expires: Mon, 29 Dec 2025 17:13:45 GMT
x-goog-hash: crc32c=y0lUcQ==, md5=/cJMRLWLPfrJoxaLG4IOuQ==
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' mdn.github.io *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-goog-meta-goog-reserved-file-mtime: 1766969340
x-frame-options: DENY
x-goog-stored-content-encoding: identity
x-goog-generation: 1766970505333630
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish, 1.1 varnish
server: Google Frontend
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
last-modified: Mon, 29 Dec 2025 01:08:25 GMT
x-goog-storage-class: STANDARD
x-cloud-trace-context: 4d4ec6859cd069ee0a5abea3b99622c8
x-content-type-options: nosniff
content-type: text/html
etag: "fdc24c44b58b3dfac9a3168b1b820eb9"
cache-control: public, max-age=3600
x-guploader-uploadid: AHVrFxOLnUf7i5WWKUHO68Kjp7TrQ4li1Q0czOlfiOeKBvhW8211Nh2zUCqmwjAWSj0Xpbv04Y8ztQE
strict-transport-security: max-age=63072000
content-encoding: gzip
accept-ranges: bytes
age: 0
date: Mon, 29 Dec 2025 16:13:45 GMT
x-served-by: cache-bfi-krnt7300031-BFI, cache-bfi-krnt7300101-BFI, cache-sin-wsat1880094-SIN, cache-bom-vanm7210091-BOM
x-cache: MISS, MISS, MISS, MISS
x-cache-hits: 0, 0, 0, 0
x-timer: S1767024825.343005,VS0,VE417
vary: Accept-Encoding
content-length: 19839
IDBKeyRange: upperBound() static method - Web APIs | MDN
IDBKeyRange.upperBound(upper)
IDBKeyRange.upperBound(upper, open)
upper
Specifies the upper bound of the new key range.
open Optional
Indicates whether the upper bound excludes the endpoint value. The default is false.
IDBKeyRange : The newly created key range.
DataError DOMException
Thrown if the key associated with the upper parameter is not a valid key.
The following example illustrates how you'd use an upper bound key range. Here we
declare keyRangeValue = IDBKeyRange.upperBound("F"); — a range that
includes the value "F" and everything before it. We open a transaction (using
IDBTransaction ) and an object store, and open a Cursor with
IDBObjectStore.openCursor , declaring keyRangeValue as its
optional key range value.
If we used IDBKeyRange.upperBound("F", true);, then the range excludes
"F"; and instead only includes the values before it.
function displayData() {
const keyRangeValue = IDBKeyRange.upperBound("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("Entries all displayed.");
}
};
}
Enable JavaScript to view this browser compatibility table.