IDBObjectStore

  • Revision slug: IndexedDB/IDBObjectStore
  • Revision title: IDBObjectStore
  • Revision id: 316897
  • Created:
  • Creator: danieljohansson
  • Is current revision? No
  • Comment

Revision Content

The IDBObjectStore interface of the IndexedDB API represents an object store in a database. Records within an object store are sorted according to their keys. This sorting enables fast insertion, look-up, and ordered retrieval. 

Method overview

IDBRequest add (in any value, in optional any key) raises (DOMException);
IDBRequest clear () raises (DOMException);
IDBRequest count (in optional any key) raises(DOMException);
IDBIndex createIndex  (in DOMString name, in DOMString keyPath, in optional boolean unique) raises (DOMException);
IDBRequest delete (in any key) raises (DOMException);
void deleteIndex (in any DOMString indexName) raises (DOMException);
IDBRequest get (in any key) raises (DOMException);
IDBIndex index (in DOMString name) raises (DOMException);
IDBRequest openCursor (in optional IDBKeyRange range, in optional unsigned short direction) raises(DOMException);
IDBRequest put (in any value, in optional any key) raises (DOMException);

Attributes

Attribute Type Description
indexNames readonly DOMStringList A list of the names of indexes on objects in this object store.
keyPath readonly DOMString The key path of this object store. If this attribute is null, the application must provide a key for each modification operation.
name readonly DOMString The name of this object store.
transaction readonly IDBTransaction The name of the transaction to which this object store belongs.
autoIncrement readonly boolean The value of the auto increment flag for this object store.

Methods

add()

Returns an IDBRequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store.

To determine if the add operation has completed successfully, listen for the transaction’s complete event in addition to the IDBObjectStore.add request’s success event, because the transaction may still fail after the success event fires.

The add method is an insert only method. If a record already exists in the object store with the key parameter as its key, then an error ConstrainError event is fired on the returned request object. {{seealso_method("put")}}

IDBRequest add (in any value, in optional any key) raises (DOMException);
Parameters
value
The value to be stored.
key
The key to use to identify the record. If unspecified, it results to null.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

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

Exception Description
ReadOnlyError The transaction associated with this operation is in read-only mode.
TransactionInactiveError This IDBObjectStore's transaction is inactive.
DataError

Any of the following conditions apply:

  • The object store uses in-line keys or has a key generator, and a key parameter was provided.
  • The object store uses out-of-line keys and has no key generator, and no key parameter was provided.
  • The object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.
  • The key parameter was provided but does not contain a valid key.
InvalidStateError The IDBObjectStore has been deleted or removed.
DataCloneError The data being stored could not be cloned by the internal structured cloning algorithm.

clear()

Creates and immediately returns an IDBRequest object, and clears this object store in a separate thread. Clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store.

IDBRequest clear () raises (DOMException);
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

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

Exception Description
ReadOnlyError The transaction associated with this operation is in read-only mode.
TransactionInactiveError This IDBObjectStore's transaction is inactive.

count()

Immediately returns an IDBRequest object and asynchronously counts the number of objects in the object store that match the parameter, a key or a key range. For the IDBRequest, the source is this IDBObjectStore, and the result holds the value that is the number of objects associated with the key or key range. If the key parameter is not valid the method throws an exception, noted below.

IDBRequest count (in optional any key) raises(DOMException);
Parameters
key
The key or key range that identifies the records to be counted.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

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

Exception Description
TransactionInactiveError This IDBObjectStore's transaction is inactive.
DataError

The key  or key range provided contains an invalid key.

InvalidStateError The IDBObjectStore has been deleted or removed.

createIndex()

Creates and returns a new IDBIndex object in the connected database. Note that this method must be called only from a VersionChange transaction mode callback.

IDBIndex createIndex  (in DOMString name, in DOMString keyPath, in optional boolean unique) raises (DOMException);
Parameters
name
The name of the index to create.
keyPath
The key path for the index to use.
optionalParameters

The IDBIndexParameters object whose attributes are optional parameters to the method. It includes the following properties:

Attribute Description
unique If true, the index will not allow duplicate values for a single key.
multientry If true, the index will add an entry in the index for each array element when the keypath resolves to an Array. If false, it will add one single entry containing the Array.
Returns
IDBIndex
The newly created index.
Exceptions

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

Exception Description
InvalidStateError The IDBObjectStore has been deleted or removed or the method was not called from a versionchange transaction mode callback.
ConstraintError An index with the same name (case-sensitive) already exists in the database.
 

delete()

Immediately returns an IDBRequest object, and removes the records specified by the given key or key range from this object store, and any indexes that reference it, in a separate thread.

IDBRequest delete (in any key) raises (DOMException);
Parameters
key
The key or key range that identifies the records.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

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

Exception Description
TransactionInactiveError This IDBObjectStore's transaction is inactive.
ReadOnlyError

The transaction associated with this operation is in read-only mode.

DataError The key or key range provided contains an invalid key.

deleteIndex()

Destroys the index with the specified name in the connected database. Note that this method must be called only from a VersionChange transaction mode callback. Note that this method synchronously modifies the indexNames property.

void deleteIndex (in any DOMString indexName) raises (DOMException);
Parameters
indexName
The name of the existing index to remove.
Returns
Void
Exceptions

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

Exception Description
InvalidStateError The method was not called from a versionchange transaction mode callback.
NotFoundError There is no index with the given name (case-sensitive) in the database.

get()

Immediately returns an IDBRequest object, and retrieves the requested record from the object store in a separate thread. If the operation is successful, then a success event is fired on the returned object, with its result set to the retrieved value, and transaction set to the transaction in which this object store is opened. 

IDBRequest get (in any key) raises (DOMException);

{{ Note("This function produces the same result if no record with the given key exists in the database as when a record exists, but with an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and no cursor if it does not.") }}

Parameters
key
The key or key range identifying the record to retrieve. In the case of a key range, the record returned is the first record associated with the first key in the range.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

 

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

Exception Description
TransactionInactiveError This IDBObjectStore's transaction is inactive.
DataError

The key or key range provided contains and invalid key.

InvalidStateError The IDBObjectStore has been deleted or removed.
 

index()

Opens the named index in this object store.

IDBIndex index (in DOMString name) raises (DOMException);
Parameters
name
The name of the index to open.
Returns
IDBIndex
An object for accessing the index.
Exceptions

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

Exception Description
InvalidStateError The source object store has been deleted, or the transaction for the object store has finished.
NotFoundError There is no index with the given name (case-sensitive) in the database.
 

openCursor()

Immediately returns an IDBRequest object, and creates a cursor over the records in this object store, in a separate thread. If there is even a single record that matches the key range, then a success event is fired on the returned object, with its result set to the IDBCursor object for the new cursor. If no records match the key range, then a success event is fired on the returned object, with its result set to null.

IDBRequest openCursor (in optional IDBKeyRange range, in optional unsigned short direction) raises(DOMException);
Parameters
range
The key range to use as the cursor's range. If this parameter is unspecified or null, then the range includes all the records in the object store.
direction
The cursor's direction.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

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

Exception Description
TransactionInactiveError This IDBObjectStore's transaction is inactive.
DataError

The key or key range provided contains and invalid key.

InvalidStateError The IDBObjectStore has been deleted or removed.
TypeError The value of the direction parameter is invalid.

put()

Returns an IDBRequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store. If the record is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and transaction set to the transaction in which this object store is opened.

The put method is an update or insert method. {{seealso_method("add")}}

IDBRequest put (in any value, in optional any key) raises (DOMException);
Parameters
value
The value to be stored.
key
The key to use to identify the record. If unspecified, it results to null.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

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

Exception Description
ReadOnlyError The transaction associated with this operation is in read-only mode.
TransactionInactiveError This IDBObjectStore's transaction is inactive.
DataError

Any of the following conditions apply:

  • The object store uses in-line keys or has a key generator, and a key parameter was provided.
  • The object store uses out-of-line keys and has no key generator, and no key parameter was provided.
  • The object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.
  • The key parameter was provided but does not contain a valid key.
InvalidStateError The IDBObjectStore has been deleted or removed.
DataCloneError The data being stored could not be cloned by the internal structured cloning algorithm.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 12 {{ CompatGeckoDesktop("2.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
count() {{ CompatUnknown() }} {{ CompatGeckoDesktop("10.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatGeckoMobile("6.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
count() {{ CompatNo() }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

 

Revision Source

<p>The <code>IDBObjectStore</code> interface of the <a href="/en/IndexedDB" title="en/IndexedDB">IndexedDB API</a> represents an <a href="/en/IndexedDB#gloss_object_store" title="en/IndexedDB#gloss object store">object store</a> in a database.&nbsp;Records within an object store are sorted according to their keys. This sorting enables fast insertion, look-up, and ordered retrieval.&nbsp;</p>
<h2 id="Method_overview">Method overview</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#add()">add</a> (in any value, in optional any key) raises (<a href="/En/DOM/DOMException" title="en/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#clear()">clear</a>&nbsp;() raises&nbsp;(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#count()">count</a> (in optional any key) raises</code><code>(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBIndex" title="en/IndexedDB/IDBIndex">IDBIndex</a> <a href="#createIndex()">createIndex</a>&nbsp; (in <a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a> name, in </code><code><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code><code> keyPath, in optional boolean unique) raises&nbsp;(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#delete()">delete</a> (in any key) raises&nbsp;</code><code>(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code>void <a href="#deleteIndex()">deleteIndex</a> (in any </code><code><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code><code> indexName) raises&nbsp;(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#get()">get</a> (in any key) raises&nbsp;(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBIndex" title="en/IndexedDB/IDBIndex">IDBIndex</a> <a href="#index()">index</a> (in </code><code><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code><code> name) raises&nbsp;(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#openCursor()">openCursor</a> (in optional <a href="/en/IndexedDB/IDBKeyRange" title="en/IndexedDB/IDBKeyRange">IDBKeyRange</a> range, in optional unsigned short direction) raises(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
    <tr>
      <td><code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#put()">put</a>&nbsp;(in any value, in optional any key) raises (<a href="/En/DOM/DOMException" title="en/DOM/DOMException">DOMException</a>);</code></td>
    </tr>
  </tbody>
</table>
<h2 id="Attributes">Attributes</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Attribute</th>
      <th scope="col">Type</th>
      <th scope="col">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td id="attr_indexNames"><code>indexNames</code></td>
      <td><code>readonly DOMStringList</code></td>
      <td>A list of the names of <a href="/en/IndexedDB#gloss_index" title="en/IndexedDB#gloss index">indexes</a> on objects in this object store.</td>
    </tr>
    <tr>
      <td id="attr_keyPath"><code>keyPath</code></td>
      <td><code>readonly </code><code><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code></td>
      <td>The <a href="/en/IndexedDB#gloss_key_path" title="en/IndexedDB#gloss key path">key path</a> of this object store. If this attribute is null, the application must provide a key for each modification operation.</td>
    </tr>
    <tr>
      <td id="attr_name"><code>name</code></td>
      <td><code>readonly </code><code><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code></td>
      <td>The name of this object store.</td>
    </tr>
    <tr>
      <td id="transaction"><code>transaction</code></td>
      <td><code>readonly <a href="/en-US/docs/IndexedDB/IDBTransaction" title="/en-US/docs/IndexedDB/IDBTransaction">IDBTransaction</a></code></td>
      <td>The name of the transaction to which this object store belongs.</td>
    </tr>
    <tr>
      <td id="autoincrement"><code>autoIncrement</code></td>
      <td><code>readonly boolean</code></td>
      <td>The value of the auto increment flag for this object store.</td>
    </tr>
  </tbody>
</table>
<h2 id="Methods">Methods</h2>
<h3 id="add()">add()</h3>
<p>Returns an <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> object, and, in a separate thread, creates a <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone">structured clone</a> of the <code>value</code>, and stores the cloned value in the object store.</p>
<p>To determine if the add operation has completed successfully, listen for the transaction’s <code>complete</code> event in addition to the <code>IDBObjectStore.add</code> request’s <code>success</code> event, because the transaction may still fail after the success event fires.</p>
<p>The add method is an<span class="database"> <em>insert only</em> </span>method. If a record already exists in the object store with the <code>key</code> parameter as its key, then an error <code>ConstrainError</code> event is fired on the returned request object. {{seealso_method("put")}}</p>
<pre>
<a href="/en/IndexedDB/IDBRequest" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/IndexedDB/IDBRequest">IDBRequest</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> </span><a href="#add" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="#add">add</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> (in any value, in optional any key) raises (</span><a href="/En/DOM/DOMException" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/DOM/DOMException">DOMException</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; ">);</span></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    value</dt>
  <dd>
    The value to be stored.</dd>
  <dt>
    key</dt>
  <dd>
    The key to use to identify the record. If unspecified, it results to null.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>ReadOnlyError</td>
      <td>The transaction associated with this operation is in read-only&nbsp;<a href="/en-US/docs/IndexedDB/IDBTransaction#mode_constants" title="/en-US/docs/IndexedDB/IDBTransaction#mode_constants">mode</a>.</td>
    </tr>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
    <tr>
      <td><span style="line-height: normal;">DataError</span></td>
      <td>
        <p>Any of the following conditions apply:</p>
        <ul>
          <li>The object store uses in-line keys or has a key generator, and a key parameter was provided.</li>
          <li>The object store uses out-of-line keys and has no key generator, and no key parameter was provided.</li>
          <li>The object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.</li>
          <li>The key parameter was provided but does not contain a valid key.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><code>InvalidStateError</code></td>
      <td>The&nbsp;IDBObjectStore&nbsp;has been deleted or removed.</td>
    </tr>
    <tr>
      <td><code>DataCloneError</code></td>
      <td>The data being stored could not be cloned by the internal structured cloning algorithm.</td>
    </tr>
  </tbody>
</table>
<h3 id="clear()">clear()</h3>
<p>Creates and immediately returns an <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> object, and clears this object store in a separate thread. Clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store.</p>
<pre>
<a href="/en/IndexedDB/IDBRequest" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/IndexedDB/IDBRequest">IDBRequest</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> </span><a href="#clear" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="#clear">clear</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> () raises (</span><a href="/en-US/docs/DOM/DOMException" style="font-family: 'Courier New', 'Andale Mono', monospace; " title="/en-US/docs/DOM/DOMException">DOMException</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; ">);</span></pre>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>ReadOnlyError</td>
      <td>The transaction associated with this operation is in read-only&nbsp;<a href="/en-US/docs/IndexedDB/IDBTransaction#mode_constants" title="/en-US/docs/IndexedDB/IDBTransaction#mode_constants">mode</a>.</td>
    </tr>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
  </tbody>
</table>
<h3 id="count()">count()</h3>
<p>Immediately returns an <a href="/en/IndexedDB/IDBRequest" title="IDBRequest">IDBRequest</a> object and asynchronously counts the number of objects in the object store that match the parameter, a key or a key range.&nbsp;For the IDBRequest, the <code>source</code> is this IDBObjectStore, and the <code>result</code> holds the value that is the number of objects associated with the key or key range.&nbsp;If the key parameter is not valid the method throws an exception, noted below.</p>
<pre>
<code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="/en/IndexedDB/IDBObjectStore#count" title="en/IndexedDB/IDBObjectStore#count">count</a> (in optional any key) raises</code><code style="font-size: 14px; color: rgb(51, 51, 51); ">(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    key</dt>
  <dd>
    The key or key range that identifies the records to be counted.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
    <tr>
      <td>DataError</td>
      <td>
        <p>The key&nbsp;&nbsp;or key range&nbsp;provided contains an invalid key.</p>
      </td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The&nbsp;IDBObjectStore&nbsp;has been deleted or removed.</td>
    </tr>
  </tbody>
</table>
<h3 id="createIndex()">createIndex()</h3>
<dl>
</dl>
<p>Creates and returns a new <a href="/en-US/docs/IndexedDB/IDBIndex" title="/en-US/docs/IndexedDB/IDBIndex">IDBIndex</a> object in the connected database. Note that this method must be called only from a <a href="/en-US/docs/IndexedDB/IDBTransaction#VERSION_CHANGE" title="/en-US/docs/IndexedDB/IDBTransaction#VERSION_CHANGE"><code>VersionChange</code></a>&nbsp;transaction mode callback.</p>
<pre>
<code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/en/IndexedDB/IDBIndex" title="en/IndexedDB/IDBIndex">IDBIndex</a> <a href="#createIndex" title="#createIndex">createIndex</a>  (in <a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a> name, in </code><code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code><code style="font-size: 14px; color: rgb(51, 51, 51); "> keyPath, in optional boolean unique) raises (<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    name</dt>
  <dd>
    The name of the index to create.</dd>
  <dt>
    keyPath</dt>
  <dd>
    The key path for the index to use.</dd>
  <dt>
    optionalParameters</dt>
  <dd>
    <p class="warning">The IDBIndexParameters object whose attributes are optional parameters to the method. It includes the following properties:</p>
    <table class="standard-table">
      <thead>
        <tr>
          <th scope="col" width="131">Attribute</th>
          <th scope="col" width="698">Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><code>unique</code></td>
          <td>If true, the index will not allow duplicate values for a single key.</td>
        </tr>
        <tr>
          <td><code>multientry</code></td>
          <td>If true, the index will add an entry in the index for each array element when the <em>keypath</em> resolves to an Array. If false, it will add one single entry containing the Array.</td>
        </tr>
      </tbody>
    </table>
  </dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <a href="/en/IndexedDB/IDBIndex" title="en/IndexedDB/IDBIndex">IDBIndex</a></dt>
  <dd>
    The newly created index.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The&nbsp;IDBObjectStore&nbsp;has been deleted or removed or the method was not called from a <code><a href="/en-US/docs/IndexedDB/IDBTransaction#VERSION_CHANGE" title="/en-US/docs/IndexedDB/IDBTransaction#VERSION_CHANGE">versionchange</a></code> transaction mode callback.</td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">ConstraintError</code></td>
      <td>An index with the same name (case-sensitive) already exists in the database.<br />
        &nbsp;</td>
    </tr>
  </tbody>
</table>
<h3 id="delete()">delete()</h3>
<dl>
</dl>
<p>Immediately returns an <code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></code> object, and removes the records specified by the given key or key range from this object store, and any indexes that reference it, in a separate thread.</p>
<pre>
<code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> <a href="#delete" title="#delete">delete</a> (in any key) raises </code><code style="font-size: 14px; color: rgb(51, 51, 51); ">(<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    key</dt>
  <dd>
    The key or key range that identifies the records.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
    <tr>
      <td>ReadOnlyError</td>
      <td>
        <p>The transaction associated with this operation is in read-only&nbsp;<a href="/en-US/docs/IndexedDB/IDBTransaction#mode_constants" title="/en-US/docs/IndexedDB/IDBTransaction#mode_constants">mode</a>.</p>
      </td>
    </tr>
    <tr>
      <td><code>DataError</code></td>
      <td>The key or key range provided contains an invalid key.</td>
    </tr>
  </tbody>
</table>
<dl>
</dl>
<h3 id="deleteIndex()">deleteIndex()</h3>
<p>Destroys the index with the specified name in the connected database. Note that this method must be called only from a <code><a href="/en/IndexedDB/IDBTransaction#VERSION_CHANGE" title="en/IndexedDB/IDBTransaction#VERSION CHANGE">VersionChange</a></code>&nbsp;transaction mode callback. Note that this method synchronously modifies the <a href="#attr_indexNames" title="#attr_indexNames">indexNames</a> property.</p>
<pre>
<code style="font-size: 14px; color: rgb(51, 51, 51); ">void <a href="#deleteIndex" title="#deleteIndex">deleteIndex</a> (in any </code><code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code><code style="font-size: 14px; color: rgb(51, 51, 51); "> indexName) raises (<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    indexName</dt>
  <dd>
    The name of the existing index to remove.</dd>
  <dt>
    Returns</dt>
  <dd>
    Void</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The method was not called from a&nbsp;<code style="font-size: 14px; "><a href="/en-US/docs/IndexedDB/IDBTransaction#VERSION_CHANGE" title="/en-US/docs/IndexedDB/IDBTransaction#VERSION_CHANGE">versionchange</a></code>&nbsp;transaction mode callback.</td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">NotFoundError</code></td>
      <td>There is no index with the given name (case-sensitive) in the database.</td>
    </tr>
  </tbody>
</table>
<h3 id="get()">get()</h3>
<p>Immediately returns an <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> object, and retrieves the requested record from the object store in a separate thread. If the operation is successful, then a success event is fired on the returned object,&nbsp;with its <code><a href="/en/IndexedDB/IDBSuccessEvent#attr_result" title="en/IndexedDB/IDBSuccessEvent#attr result">result</a></code> set to the retrieved value, and <code><a href="/en/IndexedDB/IDBTransactionEvent#attr_transaction" title="en/IndexedDB/IDBTransactionEvent#attr transaction">transaction</a></code> set to the transaction in which this object store is opened.&nbsp;</p>
<pre>
<a href="/en/IndexedDB/IDBRequest" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/IndexedDB/IDBRequest">IDBRequest</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> </span><a href="#get" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="#get">get</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> (in any key) raises (</span><a href="/en-US/docs/DOM/DOMException" style="font-family: 'Courier New', 'Andale Mono', monospace; " title="/en-US/docs/DOM/DOMException">DOMException</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; ">);</span></pre>
<p>{{ Note("This function produces the same result if no record with the given key exists in the database as when a record exists, but with an <code>undefined</code> value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and no cursor if it does not.") }}</p>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    key</dt>
  <dd>
    The key or key range identifying the record to retrieve. In the case of a key range, the record returned is the first record associated with the first key in the range.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></code></dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>&nbsp;</p>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
    <tr>
      <td>DataError</td>
      <td>
        <p>The key or key range provided contains and invalid key.</p>
      </td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The&nbsp;IDBObjectStore&nbsp;has been deleted or removed.<br />
        &nbsp;</td>
    </tr>
  </tbody>
</table>
<h3 id="index()">index()</h3>
<p>Opens the named index in this object store.</p>
<pre>
<code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/en/IndexedDB/IDBIndex" title="en/IndexedDB/IDBIndex">IDBIndex</a> <a href="#index" title="#index">index</a> (in </code><code style="font-size: 14px; color: rgb(51, 51, 51); "><a href="/En/DOM/DOMString" title="en/DOM/DOMString">DOMString</a></code><code style="font-size: 14px; color: rgb(51, 51, 51); "> name) raises (<a href="/en-US/docs/DOM/DOMException" style="line-height: 18px; " title="/en-US/docs/DOM/DOMException">DOMException</a>);</code></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    name</dt>
  <dd>
    The name of the index to open.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <code><a href="/en/IndexedDB/IDBIndex" title="en/IndexedDB/IDBIndex">IDBIndex</a></code></dt>
  <dd>
    An object for accessing the index.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The source object store has been deleted, or the transaction for the object store has finished.</td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">NotFoundError</code></td>
      <td>There is no index with the given name (case-sensitive) in the database.<br />
        &nbsp;</td>
    </tr>
  </tbody>
</table>
<h3 id="openCursor()">openCursor()</h3>
<p>Immediately returns an <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> object, and creates a <a href="/en-US/docs/IndexedDB/IDBCursor" title="en/IndexedDB#gloss cursor">cursor</a> over the records in this object store, in a separate thread. If there is even a single record that matches the <a href="/en/IndexedDB#gloss_key_range" title="en/IndexedDB#gloss key range">key range</a>, then a success event is fired on the returned object, with its <code><a href="/en/IndexedDB/IDBSuccessEvent#attr_result" title="en/IndexedDB/IDBSuccessEvent#attr result">result</a></code> set to the <a href="/en/IndexedDB/IDBCursor" title="en/IndexedDB/IDBCursor">IDBCursor</a> object for the new cursor. If no records match the key range, then a success event is fired on the returned object, with its <code><a href="/en/IndexedDB/IDBSuccessEvent#attr_result" title="en/IndexedDB/IDBSuccessEvent#attr result">result</a></code> set to null.</p>
<pre>
<a href="/en/IndexedDB/IDBRequest" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/IndexedDB/IDBRequest">IDBRequest</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> </span><a href="#openCursor" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="#openCursor">openCursor</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> (in optional </span><a href="/en/IndexedDB/IDBKeyRange" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/IndexedDB/IDBKeyRange">IDBKeyRange</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> range, in optional unsigned short direction) raises(</span><a href="/en-US/docs/DOM/DOMException" style="font-family: 'Courier New', 'Andale Mono', monospace; " title="/en-US/docs/DOM/DOMException">DOMException</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; ">);</span></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    range</dt>
  <dd>
    The key range to use as the cursor's range. If this parameter is unspecified or null, then the range includes all the records in the object store.</dd>
  <dt>
    direction</dt>
  <dd>
    The cursor's&nbsp;<a href="/en-US/docs/IndexedDB/IDBCursor" title="/en-US/docs/IndexedDB/IDBCursor">direction</a>.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    <code><a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a></code></dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
    <tr>
      <td>DataError</td>
      <td>
        <p>The key or key range provided contains and invalid key.</p>
      </td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The&nbsp;IDBObjectStore&nbsp;has been deleted or removed.</td>
    </tr>
    <tr>
      <td><code>TypeError</code></td>
      <td>The value of the <code>direction</code> parameter is invalid.</td>
    </tr>
  </tbody>
</table>
<h3 id="put()">put()</h3>
<p>Returns an <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest">IDBRequest</a> object, and, in a separate thread, creates a <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone">structured clone</a> of the <code>value</code>, and stores the cloned value in the object store. If the record is successfully stored, then a success event is fired on the returned request object&nbsp;with the <code><a href="/en-US/docs/IndexedDB/IDBRequest" title="en/IndexedDB/IDBSuccessEvent#attr result">result</a></code> set to the key for the stored record, and <code><a href="/en-US/docs/IndexedDB/IDBRequest" title="en/IndexedDB/IDBTransactionEvent#attr transaction">transaction</a></code> set to the transaction in which this object store is opened.</p>
<p>The put method is an<span class="database"> <em>update or insert</em> </span>method. {{seealso_method("add")}}</p>
<pre>
<a href="/en/IndexedDB/IDBRequest" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/IndexedDB/IDBRequest">IDBRequest</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> </span><a href="#put" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="#put">put</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; "> (in any value, in optional any key) raises (</span><a href="/En/DOM/DOMException" style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; " title="en/DOM/DOMException">DOMException</a><span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal; ">);</span></pre>
<h5 id="Parameters">Parameters</h5>
<dl>
  <dt>
    value</dt>
  <dd>
    The value to be stored.</dd>
  <dt>
    key</dt>
  <dd>
    The key to use to identify the record. If unspecified, it results to null.</dd>
</dl>
<h5 id="Returns">Returns</h5>
<dl>
  <dt>
    IDBRequest</dt>
  <dd>
    A request object on which subsequent events related to this operation are fired.</dd>
</dl>
<h5 id="Exceptions">Exceptions</h5>
<p>This method may raise a&nbsp;<a href="/en-US/docs/DOM/DOMException" title="/en-US/docs/DOM/DOMException">DOMException</a>&nbsp;with a&nbsp;<a href="/en-US/docs/DOM/DOMError" title="/en-US/docs/DOM/DOMError">DOMError</a>&nbsp;of the following types:</p>
<table class="standard-table" style="font-size: 14px; ">
  <thead>
    <tr>
      <th scope="col" width="131">Exception</th>
      <th scope="col" width="698">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>ReadOnlyError</td>
      <td>The transaction associated with this operation is in read-only <a href="/en-US/docs/IndexedDB/IDBTransaction#mode_constants" title="/en-US/docs/IndexedDB/IDBTransaction#mode_constants">mode</a>.</td>
    </tr>
    <tr>
      <td>TransactionInactiveError</td>
      <td>This IDBObjectStore's transaction is inactive.</td>
    </tr>
    <tr>
      <td>DataError</td>
      <td>
        <p>Any of the following conditions apply:</p>
        <ul>
          <li>The object store uses in-line keys or has a key generator, and a key parameter was provided.</li>
          <li>The object store uses out-of-line keys and has no key generator, and no key parameter was provided.</li>
          <li>The object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.</li>
          <li>The key parameter was provided but does not contain a valid key.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">InvalidStateError</code></td>
      <td>The&nbsp;IDBObjectStore&nbsp;has been deleted or removed.</td>
    </tr>
    <tr>
      <td><code style="font-size: 14px; ">DataCloneError</code></td>
      <td>The data being stored could not be cloned by the internal structured cloning algorithm.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>12</td>
        <td>{{ CompatGeckoDesktop("2.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>count()</code></td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("10.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE&nbsp;Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("6.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>count()</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<p>&nbsp;</p>
Revert to this revision