store . [name](#dom-idbobjectstore-name)

    Returns the of the store.

    store . [name](#dom-idbobjectstore-name) = newName

    Updates the name of the store to newName.

    Throws “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if not called within an .

    store . [keyPath](#dom-idbobjectstore-keypath)

    Returns the key path of the store, or null if none.

    list . [indexNames](#dom-idbobjectstore-indexnames)

    Returns a list of the names of indexes in the store.

    store . [transaction](#dom-idbobjectstore-transaction)

    Returns the associated .

    store . [autoIncrement](#dom-idbobjectstore-autoincrement)

    Returns true if the store has a key generator, and false otherwise.

    The name attribute’s getter must return this ‘s name.

    Is this the same as the ‘s name? As long as the has not finished, this is the same as the associated ‘s name. But once the has finished, this attribute will not reflect changes made with a later .

    The [name](#dom-idbobjectstore-name) attribute’s setter must run these steps:

    1. Let name be the given value.

    2. Let transaction be this object store handle‘s .

    3. Let store be this object store handle‘s .

    4. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is not an , throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    7. If store’s is equal to name, terminate these steps.

    8. If an object store name already exists in store’s database, a “[ConstraintError](https://www.w3.org/TR/WebIDL-1/#constrainterror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    9. Set store’s name to name.

    10. Set this ‘s name to name.

    🚧 The [name](#dom-idbobjectstore-name) attribute’s setter is new in this edition. It is supported in Chrome 58, Firefox 51, and Safari 10.1. 🚧

    The keyPath attribute’s getter must return this ‘s object store‘s , or null if none. The key path is converted as a [DOMString](https://www.w3.org/TR/WebIDL-1/#idl-DOMString) (if a string) or a (if a list of strings), per [WEBIDL].

    The returned value is not the same instance that was used when the was created. However, if this attribute returns an object (specifically an Array), it returns the same object instance every time it is inspected. Changing the properties of the object has no effect on the .

    The indexNames attribute’s getter must return a [DOMStringList](https://www.w3.org/TR/html52/single-page.html#domstringlist) associated with a sorted name list of the of indexes in this ‘s index set.

    Is this the same as ‘s list of index ? As long as the transaction has not , this is the same as the associated object store‘s list of names. But once the has finished, this attribute will not reflect changes made with a later .

    The transaction attribute’s getter must return this object store handle‘s .

    The autoIncrement attribute’s getter must return true if this object store handle‘s has a key generator, and false otherwise.

    The following methods throw a “[ReadOnlyError](https://www.w3.org/TR/WebIDL-1/#readonlyerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if called within a , and a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if called when the transaction is not .

    request = store . [put](#dom-idbobjectstore-put)(value [, key])

    request = store . [add](#dom-idbobjectstore-add)(value [, key])

    Adds or updates a record in store with the given value and key.

    If the store uses and key is specified a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) will be thrown.

    If [put()](#dom-idbobjectstore-put) is used, any existing record with the will be replaced. If [add()](#dom-idbobjectstore-add) is used, and if a record with the already exists the request will fail, with request’s [error](#dom-idbrequest-error) set to a “[ConstraintError](https://www.w3.org/TR/WebIDL-1/#constrainterror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    If successful, request’s [result](#dom-idbrequest-result) will be the record‘s .

    request = store . [delete](#dom-idbobjectstore-delete)(query)

    Deletes records in store with the given or in the given key range in query.

    If successful, request’s [result](#dom-idbrequest-result) will be undefined.

    request = store . [clear](#dom-idbobjectstore-clear)()

    Deletes all in store.

    If successful, request’s [result](#dom-idbrequest-result) will be undefined.

    The put(value, key) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is a , throw a “[ReadOnlyError](https://www.w3.org/TR/WebIDL-1/#readonlyerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. If store uses and key was given, throw a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    7. If store uses and has no key generator and key was not given, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    8. If key was given, then:

      1. Let r be the result of running the steps to convert a value to a key with key. Rethrow any exceptions.

      2. If r is invalid, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

      3. Let key be r.

    9. Let targetRealm be a user-agent defined Realm.

    10. Let clone be a of value in targetRealm. Rethrow any exceptions.

      Why create a copy of the value? The value is be serialized when stored. Treating it as a copy here allows other algorithms in this specification to treat it as an ECMAScript value, but implementations can optimize this if the difference in behavior is not observable.

    11. If store uses in-line keys, then:

      1. Let kpk be the result of running the steps to with clone and store’s key path. Rethrow any exceptions.

      2. If kpk is invalid, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

      3. If kpk is not failure, let key be kpk.

      4. Otherwise (kpk is failure):

        1. If store does not have a key generator, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

        2. Otherwise, if the steps to check that a key could be injected into a value with clone and store’s return false, throw a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    12. Run the steps to and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this object store handle as source and the steps to as operation, using store, the clone as value, key, and with the no-overwrite flag unset.

    The add(value, key) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is a , throw a “[ReadOnlyError](https://www.w3.org/TR/WebIDL-1/#readonlyerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. If store uses and key was given, throw a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    7. If store uses and has no key generator and key was not given, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    8. If key was given, then:

      1. Let r be the result of running the steps to convert a value to a key with key. Rethrow any exceptions.

      2. If r is invalid, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    9. Let targetRealm be a user-agent defined Realm.

    10. Let clone be a of value in targetRealm. Rethrow any exceptions.

      Why create a copy of the value? The value is serialized when stored. Treating it as a copy here allows other algorithms in this specification to treat it as an ECMAScript value, but implementations can optimize this if the difference in behavior is not observable.

    11. If store uses in-line keys, then:

      1. If kpk is invalid, a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

      2. If kpk is not failure, let key be kpk.

      3. Otherwise (kpk is failure):

        1. If store does not have a key generator, a ““ [DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

        2. Otherwise, if the steps to check that a key could be injected into a value with clone and store’s return false, throw a “[DataError](https://www.w3.org/TR/WebIDL-1/#dataerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    12. Run the steps to and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this object store handle as source and the steps to as operation, using store, clone as value, key, and with the no-overwrite flag set.

    The delete(query) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is a , throw a “[ReadOnlyError](https://www.w3.org/TR/WebIDL-1/#readonlyerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. Let range be the result of running the steps to with query and null disallowed flag set. Rethrow any exceptions.

    7. Run the steps to asynchronously execute a request and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this as source and the steps to delete records from an object store as operation, using store and range.

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) identifying the records keys to be deleted.

    Unlike other methods which take keys or key ranges, this method does not allow null to be given as key. This is to reduce the risk that a small bug would clear a whole object store.

    The clear() method, when invoked, must run these steps:

    1. Let transaction be this ‘s transaction.

    2. Let store be this ‘s object store.

    3. If store has been deleted, an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not active, a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is a read-only transaction, a “[ReadOnlyError](https://www.w3.org/TR/WebIDL-1/#readonlyerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. Run the steps to asynchronously execute a request and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this as source and the steps to clear an object store as operation, using store.

    The following methods throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if called when the is not active.

    request = store . [get](#dom-idbobjectstore-get)(query)

    Retrieves the of the first record matching the given or key range in query.

    If successful, request’s [result](#dom-idbrequest-result) will be the , or undefined if there was no matching record.

    request = store . [getKey](#dom-idbobjectstore-getkey)(query)

    Retrieves the of the first record matching the given or key range in query.

    If successful, request’s [result](#dom-idbrequest-result) will be the , or undefined if there was no matching record.

    request = store . [getAll](#dom-idbobjectstore-getall)(query [, count])

    Retrieves the of the records matching the given or key range in query (up to count if given).

    If successful, request’s [result](#dom-idbrequest-result) will be an of the values.

    request = store . [getAllKeys](#dom-idbobjectstore-getallkeys)(query [, count])

    Retrieves the of records matching the given or key range in query (up to count if given).

    If successful, request’s [result](#dom-idbrequest-result) will be an of the keys.

    request = store . [count](#dom-idbobjectstore-count)(query)

    Retrieves the number of matching the given key or in query.

    If successful, request’s [result](#dom-idbrequest-result) will be the count.

    The get(query) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let range be the result of running the steps to with query and null disallowed flag set. Rethrow any exceptions.

    6. Run the steps to asynchronously execute a request and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this as source and the steps to retrieve a value from an object store as operation, using the as targetRealm, store and range.

    The query parameter may be a key or an [IDBKeyRange](#idbkeyrange) identifying the to be retrieved. If a range is specified, the method retrieves the first existing value in that range.

    This method produces the same result if a record with the given key doesn’t exist as when a record exists, but has undefined as value. If you need to tell the two situations apart, you can use [openCursor()](#dom-idbobjectstore-opencursor) with the same key. This will return a cursor with undefined as value if a record exists, or no cursor if no such record exists.

    The getKey(query) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let range be the result of running the steps to with query and null disallowed flag set. Rethrow any exceptions.

    6. Run the steps to asynchronously execute a request and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this as source and the steps to retrieve a key from an object store as operation, using store and range.

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) identifying the record key to be retrieved. If a range is specified, the method retrieves the first existing key in that range.

    🚧 The [getKey()](#dom-idbobjectstore-getkey) method on [IDBObjectStore](#idbobjectstore) is new in this edition. It is supported in Chrome 58, Firefox 51, and Safari 10.1. 🚧

    The getAll(query, count) method, when invoked, must run these steps:

    1. Let transaction be this ‘s transaction.

    2. Let store be this ‘s object store.

    3. If store has been deleted, an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not active, a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let range be the result of running the steps to convert a value to a key range with query. Rethrow any exceptions.

    6. Run the steps to and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this object store handle as source and the steps to as operation, using the current Realm as targetRealm, store, range, and count if given.

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) identifying the records to be retrieved. If null or not given, an is used. If count is specified and there are more than count records in range, only the first count will be retrieved.

    🚧 The [getAll()](#dom-idbobjectstore-getall) method is new in this edition. It is supported in Chrome 48, Firefox 44, and Safari 10.1. 🚧

    The getAllKeys(query, count) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let range be the result of running the steps to with query. Rethrow any exceptions.

    6. Run the steps to asynchronously execute a request and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this as source and the steps to retrieve multiple keys from an object store as operation, using store, range, and count if given.

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) identifying the records keys to be retrieved. If null or not given, an is used. If count is specified and there are more than count keys in range, only the first count will be retrieved.

    🚧 The [getAllKeys()](#dom-idbobjectstore-getallkeys) method is new in this edition. It is supported in Chrome 48, Firefox 44, and Safari 10.1. 🚧

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If transaction is not active, a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. Let range be the result of running the steps to convert a value to a key range with query. Rethrow any exceptions.

    5. Run the steps to and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this object store handle as source and the steps to as operation, with source and range.

    The query parameter may be a key or an [IDBKeyRange](#idbkeyrange) identifying the keys to be counted. If null or not given, an unbounded key range is used.

    The following methods throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if called when the is not active.

    request = store . [openCursor](#dom-idbobjectstore-opencursor)([query [, direction = “next”]])

    Opens a over the records matching query, ordered by direction. If query is null, all in store are matched.

    If successful, request’s will be an [IDBCursorWithValue](#idbcursorwithvalue) pointing at the first matching record, or null if there were no matching .

    request = store . [openKeyCursor](#dom-idbobjectstore-openkeycursor)([query [, direction = “next”]])

    Opens a cursor with set over the records matching query, ordered by direction. If query is null, all in store are matched.

    If successful, request’s [result](#dom-idbrequest-result) will be an [IDBCursor](#idbcursor) pointing at the first matching record, or null if there were no matching .

    The openCursor(query, direction) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let range be the result of running the steps to with query. Rethrow any exceptions.

    6. Let cursor be a new cursor with set to transaction, an undefined position, set to direction, got value flag unset, and undefined and value. The of cursor is store. The range of cursor is range.

    7. Run the steps to and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this object store handle as source and the steps to as operation, using the current Realm as targetRealm, and cursor.

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) to use as the cursor‘s . If null or not given, an unbounded key range is used.

    The openKeyCursor(query, direction) method, when invoked, must run these steps:

    1. Let transaction be this ‘s transaction.

    2. Let store be this ‘s object store.

    3. If store has been deleted, an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction is not active, a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let range be the result of running the steps to convert a value to a key range with query. Rethrow any exceptions.

    6. Let cursor be a new with transaction set to transaction, an undefined , direction set to direction, unset, and undefined key and . The source of cursor is store. The of cursor is range. The key only flag of cursor is set.

    7. Run the steps to and return the [IDBRequest](#idbrequest) created by these steps. The steps are run with this object store handle as source and the steps to as operation, using the current Realm as targetRealm, and cursor.

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) to use as the cursor‘s . If null or not given, an unbounded key range is used.

    🚧 The [openKeyCursor()](#dom-idbobjectstore-openkeycursor) method is new in this edition. It is supported in Chrome 48, Firefox 44, and Safari 10.1. 🚧

    index = store . index(name)

    Returns an [IDBIndex](#idbindex) for the named name in store.

    index = store . [createIndex](#dom-idbobjectstore-createindex)(name, keyPath [, options])

    Creates a new index in store with the given name, keyPath and options and returns a new [IDBIndex](#idbindex). If the keyPath and options define constraints that cannot be satisfied with the data already in store the will abort with a “[ConstraintError](https://www.w3.org/TR/WebIDL-1/#constrainterror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    Throws an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if not called within an .

    store . [deleteIndex](#dom-idbobjectstore-deleteindex)(name)

    Deletes the index in store with the given name.

    Throws an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) if not called within an .

    The createIndex(name, keyPath, options) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If transaction is not an upgrade transaction, an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. If an named name already exists in store, a “[ConstraintError](https://www.w3.org/TR/WebIDL-1/#constrainterror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    7. If keyPath is not a valid key path, a “[SyntaxError](https://www.w3.org/TR/WebIDL-1/#syntaxerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    8. Let unique be set if options’s [unique](#dom-idbindexparameters-unique) member is true, and unset otherwise.

    9. Let multiEntry be set if options’s [multiEntry](#dom-idbindexparameters-multientry) member is true, and unset otherwise.

    10. If keyPath is a sequence and multiEntry is set, throw an “[InvalidAccessError](https://www.w3.org/TR/WebIDL-1/#invalidaccesserror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    11. Let index be a new in store. Set index’s name to name and to keyPath. If unique is set, set index’s unique flag. If multiEntry is set, set index’s .

    12. Add index to this object store handle‘s .

    13. Return a new index handle associated with index and this .

    This method creates and returns a new index with the given name in the . Note that this method must only be called from within an upgrade transaction.

    The index that is requested to be created can contain constraints on the data allowed in the index’s object store, such as requiring uniqueness of the values referenced by the index’s keyPath. If the referenced object store already contains data which violates these constraints, this must not cause the implementation of [createIndex()](#dom-idbobjectstore-createindex) to throw an exception or affect what it returns. The implementation must still create and return an [IDBIndex](#idbindex) object, and the implementation must to abort the upgrade transaction which was used for the [createIndex()](#dom-idbobjectstore-createindex) call.

    This method synchronously modifies the [indexNames](#dom-idbobjectstore-indexnames) property on the [IDBObjectStore](#idbobjectstore) instance on which it was called. Although this method does not return an [IDBRequest](#idbrequest) object, the index creation itself is processed as an asynchronous request within the .

    In some implementations it is possible for the implementation to asynchronously run into problems creating the index after the createIndex method has returned. For example in implementations where metadata about the newly created index is queued up to be inserted into the database asynchronously, or where the implementation might need to ask the user for permission for quota reasons. Such implementations must still create and return an [IDBIndex](#idbindex) object, and once the implementation determines that creating the index has failed, it must abort the transaction using the steps to abort a transaction using an appropriate error as error. For example if creating the failed due to quota reasons, a “[QuotaExceededError](https://www.w3.org/TR/WebIDL-1/#quotaexceedederror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) must be used as error and if the index can’t be created due to unique flag constraints, a “[ConstraintError](https://www.w3.org/TR/WebIDL-1/#constrainterror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) must be used as error.

    The asynchronous creation of indexes is observable in the following example:

    1. var request1 = objectStore.put({name: "betty"}, 1);
    2. var request2 = objectStore.put({name: "betty"}, 2);
    3. var index = objectStore.createIndex("by_name", "name", {unique: true});

    At the point where [createIndex()](#dom-idbobjectstore-createindex) called, neither of the requests have executed. When the second request executes, a duplicate name is created. Since the index creation is considered an asynchronous , the index’s uniqueness constraint does not cause the second to fail. Instead, the transaction will be when the index is created and the constraint fails.

    The index(name) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If transaction has , throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. Let index be the named name in this ‘s index set if one exists, or a “[NotFoundError](https://www.w3.org/TR/WebIDL-1/#notfounderror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) otherwise.

    6. Return an index handle associated with index and this .

    Each call to this method on the same [IDBObjectStore](#idbobjectstore) instance with the same name returns the same [IDBIndex](#idbindex) instance.

    The returned [IDBIndex](#idbindex) instance is specific to this [IDBObjectStore](#idbobjectstore) instance. If this method is called on a different [IDBObjectStore](#idbobjectstore) instance with the same name, a different [IDBIndex](#idbindex) instance is returned.

    The deleteIndex(name) method, when invoked, must run these steps:

    1. Let transaction be this object store handle‘s .

    2. Let store be this object store handle‘s .

    3. If transaction is not an upgrade transaction, an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    4. If store has been deleted, throw an “[InvalidStateError](https://www.w3.org/TR/WebIDL-1/#invalidstateerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    5. If transaction is not , throw a “[TransactionInactiveError](https://www.w3.org/TR/WebIDL-1/#transactioninactiveerror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException).

    6. Let index be the named name in store if one exists, or a “[NotFoundError](https://www.w3.org/TR/WebIDL-1/#notfounderror)[DOMException](https://www.w3.org/TR/WebIDL-1/#idl-DOMException) otherwise.

    7. Destroy index.

    This method synchronously modifies the [indexNames](#dom-idbobjectstore-indexnames) property on the [IDBObjectStore](#idbobjectstore) instance on which it was called. Although this method does not return an object, the index destruction itself is processed as an asynchronous request within the upgrade transaction.