This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

The IDBLocaleAwareKeyRange interface of the IndexedDB API is a Firefox-specific version of IDBKeyRange — it functions in exactly the same fashion, and has the same properties and methods, but it is intended for use with IDBIndex objects when the original index had a locale value specified upon its creation (see createIndex()'s optionalParameters) — that is, it has locale aware sorting enabled.


This interface inherits all the methods of its parent interface, IDBKeyRange.


This interface inherits all the properties of its parent interface, IDBKeyRange.

Bear in mind however that IDBLocaleAwareKeyRange has its own implementation of IDBKeyRange.bound. This is because when you use bound(), it checks if lower bound < upper bound, and throws an exception if that’s not the case. With locale-aware indexes, the meaning of < depends on the locale, so for example in Lithuanian Y is sorted between I and K. The only difference between IDBKeyRange and IDBLocaleAwareKeyRange is that the latter doesn’t do the aforementioned check.

Developers should always use IDBLocaleAwareKeyRange when dealing with locale-aware indexes.


function displayData() {
  var keyRangeValue = IDBLocaleAwareKeyRange.bound("A", "F");

  var transaction = db.transaction(['fThings'], 'readonly');
  var objectStore = transaction.objectStore('fThings');

  var myIndex = objectStore.index('lName');
  myIndex.openCursor(keyRangeValue).onsuccess = function(event) {
    var cursor =;
    if(cursor) {
      var tableRow = document.createElement('tr');
      tableRow.innerHTML =   '&lt;td&gt;' + + '&lt;/td&gt;'
                           + '&lt;td&gt;' + cursor.value.lName + '&lt;/td&gt;'
                           + '&lt;td&gt;' + cursor.value.fName + '&lt;/td&gt;'
                           + '&lt;td&gt;' + cursor.value.jTitle + '&lt;/td&gt;'
                           + '&lt;td&gt;' + + '&lt;/td&gt;'
                           + '&lt;td&gt;' + cursor.value.eMail + '&lt;/td&gt;'
                           + '&lt;td&gt;' + + '&lt;/td&gt;'
                           + '&lt;td&gt;' + cursor.value.age + '&lt;/td&gt;';

    } else {
      console.log('Entries all displayed.');    


Not currently part of any specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support Not supported 43.0 (43.0)[1] Not supported Not supported Not supported
Feature Android Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support Not supported 43.0 (43.0)[1] 2.5[1] Not supported Not supported Not supported

[1] This feature is currently hidden behind a flag — to enable it and experiment, go to about:config and enable dom.indexedDB.experimental.

See also

Document Tags and Contributors

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