...

/

Creating a Cursor for the Object Store

Creating a Cursor for the Object Store

Learn to create a cursor for an object store.

The openCursor() method

The openCursor() method is used to open a cursor across one of the object stores in an IndexedDB database. It allows us to iterate over the records in the store, searching for a specific key or range of keys.

Syntax

openCursor()
openCursor(query)
openCursor(query, direction)
Syntax of the openCursor() method

The openCursor() method has two optional parameters that can be used to specify the cursor options:

  • query: This parameter specifies the key or the key range ...