index . [name](#dom-idbindex-name)

    Returns the of the index.

    index . [name](#dom-idbindex-name) = newName

    Updates the name of the store to newName.

    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 .

    index . [objectStore](#dom-idbindex-objectstore)

    Returns the [IDBObjectStore](#idbobjectstore) the index belongs to.

    index . keyPath

    Returns the key path of the index.

    index . multiEntry

    Returns true if the index’s is set.

    index . unique

    Returns true if the index’s unique flag is set.

    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-idbindex-name) attribute’s setter must run these steps:

    1. Let name be the given value.

    2. Let transaction be this index handle‘s .

    3. Let index be this index handle‘s .

    4. 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).

    5. 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).

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

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

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

    9. Set index’s to name.

    10. Set this index handle‘s to name.

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

    The objectStore attribute’s getter must return this index handle‘s .

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

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

    The multiEntry attribute’s getter must return true if this ‘s index‘s is set, and false otherwise.

    The unique attribute’s getter must return true if this index handle‘s ‘s unique flag is set, and false otherwise.

    The following methods throw an “[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-idbindex-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-idbindex-getkey)(query)

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

    request = store . [getAll](#dom-idbindex-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 . (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-idbindex-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 index handle‘s .

    2. Let index be this index handle‘s .

    3. If index or index’s object 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 and null disallowed flag set. Rethrow any exceptions.

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

    The query parameter may be a or an [IDBKeyRange](#idbkeyrange) identifying the record to be retrieved. If a range is specified, the method retrieves the first existing record 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-idbindex-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 ‘s transaction.

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

    3. 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).

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

    5. 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 index as operation, using index 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 getAll(query, count) method, when invoked, must run these steps:

    1. Let transaction be this ‘s transaction.

    2. Let index be this ‘s index.

    3. If index or index’s 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 referenced values from an index as operation, using the as targetRealm, index, range, and count if given.

    The query parameter may be a key or an [IDBKeyRange](#idbkeyrange) identifying the to be retrieved. If null or not given, an unbounded key range 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-idbindex-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 ‘s transaction.

    2. Let index be this ‘s index.

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

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

    5. 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 values from an index as operation, using index, 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-idbindex-getallkeys) method is new in this edition. It is supported in Chrome 48, Firefox 44, and Safari 10.1. 🚧

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

    1. Let transaction be this index handle‘s .

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

    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 index handle as source and the steps to as operation, with index as source and range.

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

    The following methods throw an “[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 . [openCursor](#dom-idbindex-opencursor)([query [, direction = “next”]])

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

    If successful, request’s [result](#dom-idbrequest-result) will be an [IDBCursorWithValue](#idbcursorwithvalue), or null if there were no matching .

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

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

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

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

    1. Let transaction be this ‘s transaction.

    2. Let index be this ‘s index.

    3. If index or index’s 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 index. 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 index 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 index be this ‘s index.

    3. If index or index’s 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 index. The range of cursor is range. The of cursor is set.

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