Cursor

class Cursor(source)

An opaque position in a result sequence: the hits strictly past (docId, nodePre) in the order of the search that produced it — after it for SearchOrder.ASCENDING, before it for SearchOrder.DESCENDING. toString gives a compact URL-safe text, and parse reads it back. A cursor resumes only what produced it: a search of the same SearchOrder and kind, or JsonStore.objectsOfTypePage for the cursor of a TypePage; anything else throws InvalidCursorException.

A cursor used in a new search sees the store's newer state. A document whose insert started before the cursor's page was produced but was acknowledged later can land in the stretch the earlier pages already covered and is then missed; mayMissLateCommits tells whether that's possible. A descending search resumed from a cursor never returns documents above the cursor's, so documents inserted since the first page aren't returned either.

The cursor of a DocumentKeyQuery is a position in key order: it resumes strictly past the key of its last hit (docId is that hit's document, nodePre 0), so a document inserted since with a key the earlier pages passed isn't returned. Its text is at most about 1,400 characters, as it holds the key.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

True when an insert that was still in flight at snapshotLsn has a docId the earlier pages already passed: below docId in an ascending search, above it in a descending one. For the cursor of a DocumentKeyQuery, true when any insert was in flight then, as its key can't be known.

Link copied to clipboard
Link copied to clipboard

The snapshot of the page that produced the cursor.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String