Search⌘ K
AI Features

Configuring the Range and Direction of the Cursor

Explore how to configure the range and direction of an IndexedDB cursor to control data traversal within object stores. Learn to move forward or backward through data, handle unique records, and optimize retrieval using different cursor settings. This lesson guides you in practical cursor management for effective client-side data handling.

The direction property

We can set the cursor’s direction when traversing through the data in the object store. The direction property can be one of the following values:

  • next: The cursor is moving forward, from the beginning of the object store to the end.

  • prev: The cursor is moving backward, from the end of the object store to the beginning.

  • nextunique: The cursor is moving forward ...