Index

js.html.idb.Index (extern class)

IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data.

Documentation IDBIndex by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

name: String

The name of this index.


objectStore: ObjectStore

The name of the object store referenced by this index.


keyPath: Dynamic

The key path of this index. If null, this index is not auto-populated.


multiEntry: Bool

Affects how the index behaves when the result of evaluating the index's key path yields an array. If true, there is one record in the index for each item in an array of keys. If false, then there is one record for each key that is an array.


unique: Bool

If true, this index does not allow duplicate values for a key.


openCursor(?range: Dynamic, ?direction: CursorDirection = NEXT): Request

Returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range.

Name Type Default
range Dynamic (optional)
direction CursorDirection NEXT
Returns
Request

openKeyCursor(?range: Dynamic, ?direction: CursorDirection = NEXT): Request

Returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index.

Name Type Default
range Dynamic (optional)
direction CursorDirection NEXT
Returns
Request

get(key: Dynamic): Request

Returns an IDBRequest object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is an IDBKeyRange.

Name Type
key Dynamic
Returns
Request

getKey(key: Dynamic): Request

Returns an IDBRequest object, and, in a separate thread, finds either the given key or the primary key, if key is an IDBKeyRange.

Name Type
key Dynamic
Returns
Request

count(?key: Dynamic): Request

Returns an IDBRequest object, and in a separate thread, returns the number of records within a key range.

Name Type Default
key Dynamic (optional)
Returns
Request

getAll(?key: Dynamic, ?limit: Int): Request

Returns an IDBRequest object, in a separate thread, finds all matching values in the referenced object store that correspond to the given key or are in range, if key is an IDBKeyRange.

Name Type Default
key Dynamic (optional)
limit Int (optional)
Returns
Request

getAllKeys(?key: Dynamic, ?limit: Int): Request

Returns an IDBRequest object, in a separate thread, finds all matching keys in the referenced object store that correspond to the given key or are in range, if key is an IDBKeyRange.

Name Type Default
key Dynamic (optional)
limit Int (optional)
Returns
Request