Your Search Results


    This article is in need of a technical review.

    « IDBKeyRange

    The IDBKeyRange.upperBound method creates a new upper-bound key range.

    By default, it includes the upper endpoint value and is closed.


    static IDBKeyRange upperBound (any upper, optional boolean open = false);


    // Let us open our database
    var request ="toDoList", 4);
    // store the result of opening the database in the db variable.
    db = request.result;
    // Open a transaction on the current database and get a reference to the object store
    //that we want to pull information out of
    var transaction = db.transaction(["toDoList"]);
    var objectStore = transaction.objectStore("toDoList");
    // Match anything up to, but not including, "Ask friends to tea"
    var upperBoundOpenKeyRange = IDBKeyRange.upperBound("Ask friends to tea", true);
    // To use one of the key ranges, pass it in as the first argument of openCursor()/openKeyCursor()
    index.openCursor(upperBoundOpenKeyRange).onsuccess = function(event) {
      var cursor =;
      if (cursor) {
        // Do something with the matches.


    The value of the upper bound of the range.
    Optional. If false (default value), the range includes the lower-bound value.


    The newly created key range.


    This method may raise a DOMException with a DOMError of the following types:

    Exception Description

    The value parameter passed was not a valid key.


    Specification Status Comment
    Indexed Database API Candidate Recommendation  

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
    Basic support 12 -webkit
    4.0 (2.0) 10 17 Not supported
    Feature Android Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
    Basic support 4.4 6.0 (6.0) 1.0.1 10 17 Not supported

    Be careful in Chrome as it still implements the old specification along the new one. Similarly it still has the prefixed webkitIndexedDB property even if the unprefixed indexedDB is present.

    See also

    • Using IndexedDB
    • The reference application for the examples in this reference: To-do Notifications (view example live.) Not every snippet appears in this example, but every example uses the same data structure and syntax, and they will make sense in the context of this example.

    Document Tags and Contributors

    Contributors to this page: chrisdavidmills
    Last updated by: chrisdavidmills,