Class

org.scalajs.dom

IDBIndex

Related Doc: package dom

Permalink

class IDBIndex extends Object with IDBStoreLike[IDBIndex]

The 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.

You can retrieve records in an object store through their keys or by using an index (cursors provide a third way: see IDBCursor). An index lets you look up records in an object store using properties of the values in the object stores records.

The index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. The records in an index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. Each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. When the object store changes, all indexes that refers to the object store are automatically updated.

Annotations
@JSType() @native() @JSGlobal()
Linear Supertypes
IDBStoreLike[IDBIndex], Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IDBIndex
  2. IDBStoreLike
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new IDBIndex()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def count(query: |[IDBKey, IDBKeyRange] = js.native): IDBRequest[IDBIndex, Double]

    Permalink
    Definition Classes
    IDBStoreLike
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def get(key: |[IDBKey, IDBKeyRange]): IDBRequest[IDBIndex, IDBValue]

    Permalink

    Returns an IDBRequest object, and, in a separate thread, returns the object store selected by the specified key.

    Returns an IDBRequest object, and, in a separate thread, returns the object store selected by the specified key. This is for retrieving specific records from an object store.

    Note: This method produces the same result for: a) a record that doesn't exist in the database and b) a record that has 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.

    Definition Classes
    IDBStoreLike
  11. def getAll(query: UndefOr[|[IDBKeyRange, IDBKey]] = js.native, count: UndefOr[Double] = js.native): IDBRequest[IDBIndex, Array[IDBValue]]

    Permalink

    Returns an IDBRequest object containing all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.

    Returns an IDBRequest object containing all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.

    If a value is successfully found, then a structured clone of it is created and set as the result of the request object.

    This method produces the same result for:

    • a record that doesn't exist in the database
    • a record that has an undefined value

    To tell these situations apart, you either call

    • the openCursor method with the same key. That method provides a cursor if the record exists, and no cursor if it does not.
    • the count method with the same key, which will return 1 if the row exists and 0 if it doesn't.
    Definition Classes
    IDBStoreLike
  12. def getAllKeys(query: UndefOr[|[IDBKeyRange, IDBKey]] = js.native, count: UndefOr[Double] = js.native): IDBRequest[IDBIndex, Array[IDBKey]]

    Permalink

    Returns an IDBRequest object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.

    Returns an IDBRequest object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.

    If a value is successfully found, then a structured clone of it is created and set as the result of the request object.

    This method produces the same result for:

    • a record that doesn't exist in the database
    • a record that has an undefined value

    To tell these situations apart, you need to call the openCursor method with the same key. That method provides a cursor if the record exists, and no cursor if it does not.

    Definition Classes
    IDBStoreLike
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getKey(key: IDBKey): IDBRequest[IDBIndex, UndefOr[IDBKey]]

    Permalink

    Returns an IDBRequest object, and, in a separate thread, returns the key selected by the specified query.

    Returns an IDBRequest object, and, in a separate thread, returns the key selected by the specified query. This is for retrieving specific records from an object store.

    Definition Classes
    IDBStoreLike
  15. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  19. def keyPath: IDBKeyPath

    Permalink

    The key path of this object store.

    The key path of this object store. If this attribute is null, the application must provide a key for each modification operation.

    Definition Classes
    IDBStoreLike
  20. val multiEntry: Boolean

    Permalink

    Returns a boolean value that affects how the index behaves when the result of evaluating the index's key path yields an array.

    Returns a boolean value that affects how the index behaves when the result of evaluating the index's key path yields an array.

    This is decided when the index is created, using the IDBObjectStore.createIndex method. This method takes an optional options parameter whose multiEntry property is set to true/false.

  21. def name: String

    Permalink
    Definition Classes
    IDBStoreLike
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def objectStore: IDBObjectStore

    Permalink

    The name of the object store referenced by this index.

  26. def openCursor(range: UndefOr[|[IDBKeyRange, IDBKey]] = js.native, direction: UndefOr[IDBCursorDirection] = js.native): IDBRequest[IDBIndex, IDBCursor[IDBIndex]]

    Permalink

    The method sets the position of the cursor to the appropriate record, based on the specified direction.

    The method sets the position of the cursor to the appropriate record, based on the specified direction.

    returns

    IDBRequest with the target value being a new cursor or null.

    Definition Classes
    IDBStoreLike
  27. def openKeyCursor(range: UndefOr[|[IDBKeyRange, IDBKey]] = js.native, direction: UndefOr[IDBCursorDirection] = js.native): IDBRequest[IDBIndex, IDBCursorReadOnly[IDBIndex]]

    Permalink

    The method sets the position of the cursor to the appropriate key, based on the specified direction.

    The method sets the position of the cursor to the appropriate key, based on the specified direction.

    returns

    IDBRequest with the target value being a new cursor or null.

    Definition Classes
    IDBStoreLike
  28. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. def unique: Boolean

    Permalink

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

  33. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from IDBStoreLike[IDBIndex]

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped