IdbObjectStore Class

An object store handle (https://w3c.github.io/IndexedDB/#idbobjectstore).

public sealed class IdbObjectStore

Properties

NameDescription
AutoIncrementGets whether the object store has a key generator.
IndexNamesGets the sorted names of the indexes of the object store.
KeyPathGets the key path of the object store: a string, an array of strings (the same array each time), or null.
NameGets or sets the name of the object store (it can only be changed in an upgrade transaction).
TransactionGets the transaction of the handle.

AutoIncrement

IdbObjectStore.cs

Gets whether the object store has a key generator.

public bool AutoIncrement { get; }

Gets the sorted names of the indexes of the object store.

public DomStringList IndexNames { get; }

Gets the key path of the object store: a string, an array of strings (the same array each time), or null.

public object? KeyPath { get; }

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

public string Name { get; set; }

Gets the transaction of the handle.

public IdbTransaction Transaction { get; }

Methods

NameDescription
Add(object?, object?)Adds a record, which fails when a record with the same key exists (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-add).
Clear()Deletes all the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-clear).
Count(object?)Counts the records with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-count).
CreateIndex(string, object?, IdbIndexParameters?)Creates an index in an upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-createindex).
Delete(object?)Deletes the records with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-delete).
DeleteIndex(string)Deletes an index in an upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-deleteindex).
Get(object?)Retrieves the value of the first record with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-get).
GetAll(object?, uint?)Retrieves the values of the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getall).
GetAllKeys(object?, uint?)Retrieves the keys of the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getallkeys).
GetAllRecords(IdbGetAllOptions?)Retrieves the keys and the values of the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getallrecords).
GetKey(object?)Retrieves the key of the first record with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getkey).
Index(string)Returns the handle of an index (the same handle for the same name) (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-index).
OpenCursor(object?, IdbCursorDirection)Opens a cursor over the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-opencursor).
OpenKeyCursor(object?, IdbCursorDirection)Opens a cursor over the keys of the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-openkeycursor).
Put(object?, object?)Adds or replaces a record (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-put).

Add(object?, object?)

IdbObjectStore.cs

Adds a record, which fails when a record with the same key exists (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-add).

public IdbRequest Add(object? value, object? key = null)

Deletes all the records (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-clear).

public IdbRequest Clear()

Count(object?)

IdbObjectStore.cs

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

public IdbRequest Count(object? query = null)

CreateIndex(string, object?, IdbIndexParameters?)

IdbObjectStore.cs

Creates an index in an upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-createindex).

public IdbIndex CreateIndex(string name, object? keyPath, IdbIndexParameters? options = null)

Delete(object?)

IdbObjectStore.cs

Deletes the records with a key or in a key range (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-delete).

public IdbRequest Delete(object? query)

DeleteIndex(string)

IdbObjectStore.cs

Deletes an index in an upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-deleteindex).

public void DeleteIndex(string name)

Get(object?)

IdbObjectStore.cs

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

public IdbRequest Get(object? query)

GetAll(object?, uint?)

IdbObjectStore.cs

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

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

GetAllKeys(object?, uint?)

IdbObjectStore.cs

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

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

GetAllRecords(IdbGetAllOptions?)

IdbObjectStore.cs

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

public IdbRequest GetAllRecords(IdbGetAllOptions? options = null)

GetKey(object?)

IdbObjectStore.cs

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

public IdbRequest GetKey(object? query)

Index(string)

IdbObjectStore.cs

Returns the handle of an index (the same handle for the same name) (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-index).

public IdbIndex Index(string name)

OpenCursor(object?, IdbCursorDirection)

IdbObjectStore.cs

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

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

OpenKeyCursor(object?, IdbCursorDirection)

IdbObjectStore.cs

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

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

Put(object?, object?)

IdbObjectStore.cs

Adds or replaces a record (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-put).

public IdbRequest Put(object? value, object? key = null)