Index class abstract
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 the primary key or by using an index. An index lets you look up records in an object store using properties of the values in the object stores records other than the primary key
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.
Constructors
- Index()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- keyPath → Object
-
returns the key path of the current index. If null, this index is not
auto-populated.
no setter
- multiEntry → bool
-
returns a boolean value that affects how the index behaves when the result
of evaluating the index's key path yields an array.
no setter
- name → String
-
returns the name of the current index.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unique → bool
-
states whether the index allows duplicate keys or not.
no setter
Methods
-
count(
[Object? keyOrRange]) → Future< int> - returns the number of records within a key range.
-
get(
Object key) → Future< Object?> - finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to a KeyRange
-
getAll(
[Object? query, int? count]) → Future< List< Object> > - returns all objects in the index matching the specified parameter or all objects in the index if no parameters are given.
-
getAllKeys(
[Object? query, int? count]) → Future< List< Object> > - returns record primary keys for all objects in the index store matching the specified parameter or all objects in the index if no parameters are given.
-
getKey(
Object key) → Future< Object?> - finds either the given key or the primary key, if key is set to a KeyRange.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openCursor(
{Object? key, KeyRange? range, String? direction, bool? autoAdvance}) → Stream< CursorWithValue> - Creates a cursor over the specified key range.
-
openKeyCursor(
{Object? key, KeyRange? range, String? direction, bool? autoAdvance}) → Stream< Cursor> - Creates a key cursor over the specified key range.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited