IdbIndex Class

An index handle (https://w3c.github.io/IndexedDB/#idbindex).

public sealed class IdbIndex

Properties

NameDescription
KeyPathGets the key path of the index: a string or an array of strings (the same array each time).
MultiEntryGets whether an array key adds a record per item.
NameGets or sets the name of the index (it can only be changed in an upgrade transaction).
ObjectStoreGets the object store handle of the index.
UniqueGets whether the keys of the index are unique.

Gets the key path of the index: a string or an array of strings (the same array each time).

public object? KeyPath { get; }

MultiEntry

IdbIndex.cs

Gets whether an array key adds a record per item.

public bool MultiEntry { get; }

Gets or sets the name of the index (it can only be changed in an upgrade transaction).

public string Name { get; set; }

ObjectStore

IdbIndex.cs

Gets the object store handle of the index.

public IdbObjectStore ObjectStore { get; }

Gets whether the keys of the index are unique.

public bool Unique { get; }

Methods

NameDescription
Count(object?)Counts the index records with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbindex-count).
Get(object?)Retrieves the value of the record referenced by the first index record with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbindex-get).
GetAll(object?, uint?)Retrieves the values of the records (https://w3c.github.io/IndexedDB/#dom-idbindex-getall).
GetAllKeys(object?, uint?)Retrieves the primary keys of the records (https://w3c.github.io/IndexedDB/#dom-idbindex-getallkeys).
GetAllRecords(IdbGetAllOptions?)Retrieves the keys, the primary keys and the values of the records (https://w3c.github.io/IndexedDB/#dom-idbindex-getallrecords).
GetKey(object?)Retrieves the primary key of the first index record with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbindex-getkey).
OpenCursor(object?, IdbCursorDirection)Opens a cursor over the index records (https://w3c.github.io/IndexedDB/#dom-idbindex-opencursor).
OpenKeyCursor(object?, IdbCursorDirection)Opens a cursor over the keys of the index records (https://w3c.github.io/IndexedDB/#dom-idbindex-openkeycursor).

Count(object?)

IdbIndex.cs

Counts the index records with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbindex-count).

public IdbRequest Count(object? query = null)

Get(object?)

IdbIndex.cs

Retrieves the value of the record referenced by the first index record with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbindex-get).

public IdbRequest Get(object? query)

GetAll(object?, uint?)

IdbIndex.cs

Retrieves the values of the records (https://w3c.github.io/IndexedDB/#dom-idbindex-getall).

public IdbRequest GetAll(object? queryOrOptions = null, uint? count = null)

GetAllKeys(object?, uint?)

IdbIndex.cs

Retrieves the primary keys of the records (https://w3c.github.io/IndexedDB/#dom-idbindex-getallkeys).

public IdbRequest GetAllKeys(object? queryOrOptions = null, uint? count = null)

GetAllRecords(IdbGetAllOptions?)

IdbIndex.cs

Retrieves the keys, the primary keys and the values of the records (https://w3c.github.io/IndexedDB/#dom-idbindex-getallrecords).

public IdbRequest GetAllRecords(IdbGetAllOptions? options = null)

GetKey(object?)

IdbIndex.cs

Retrieves the primary key of the first index record with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbindex-getkey).

public IdbRequest GetKey(object? query)

OpenCursor(object?, IdbCursorDirection)

IdbIndex.cs

Opens a cursor over the index records (https://w3c.github.io/IndexedDB/#dom-idbindex-opencursor).

public IdbRequest OpenCursor(object? query = null, IdbCursorDirection direction = IdbCursorDirection.Next)

OpenKeyCursor(object?, IdbCursorDirection)

IdbIndex.cs

Opens a cursor over the keys of the index records (https://w3c.github.io/IndexedDB/#dom-idbindex-openkeycursor).

public IdbRequest OpenKeyCursor(object? query = null, IdbCursorDirection direction = IdbCursorDirection.Next)