A has a transaction, the transaction that was when the cursor was created.

    A cursor has a range of records in either an or an object store.

    A has a source that indicates which index or an is associated with the records over which the cursor is iterating.

    A has a direction that determines whether it moves in monotonically increasing or decreasing order of the record keys when iterated, and if it skips duplicated values when iterating indexes. The direction of a cursor also determines if the cursor initial position is at the start of its or at its end. A cursor’s direction is one of the following:

    ["nextunique"](#dom-idbcursordirection-nextunique)

    This direction causes the cursor to be opened at the start of the . When iterated, the cursor should not yield records with the same key, but otherwise yield all records, in monotonically increasing order of keys. For every key with duplicate values, only the first record is yielded. When the is an object store or an with the unique flag set, this direction has exactly the same behavior as .

    ["prev"](#dom-idbcursordirection-prev)

    This direction causes the cursor to be opened at the end of the . When iterated, the cursor should yield all records, including duplicates, in monotonically decreasing order of keys.

    A has a position within its range. It is possible for the list of records which the cursor is iterating over to change before the full range of the cursor has been iterated. In order to handle this, cursors maintain their not as an index, but rather as a key of the previously returned record. For a forward iterating cursor, the next time the cursor is asked to iterate to the next record it returns the record with the lowest greater than the one previously returned. For a backwards iterating cursor, the situation is opposite and it returns the record with the highest less than the one previously returned.

    For cursors iterating indexes the situation is a little bit more complicated since multiple records can have the same key and are therefore also sorted by . When iterating indexes the cursor also has an object store position, which indicates the of the previously found record in the index. Both and the object store position are used when finding the next appropriate record.

    A has a key and a value which represent the key and the of the last iterated record.

    A has a got value flag. When this flag unset, the cursor is either in the process of loading the next value or it has reached the end of its range. When it is set, it indicates that the cursor is currently holding a value and that it is ready to iterate to the next one.

    If the of a cursor is an object store, the effective object store of the cursor is that object store and the effective key of the cursor is the cursor’s . If the source of a cursor is an , the effective object store of the cursor is that index’s object store and the effective key is the cursor’s .