Row

class Row

One result: a key, and whatever the projection asked for.

A row is a view, not a copy. Every Variant in it reads straight out of a mapped segment, so a row is valid while the snapshot behind the query is open and not afterwards — the same trade DocumentStore.get offers, and the reason a snapshot exists at all. A caller who needs a row to outlive its snapshot takes toJsonString or Variant.toByteArray, and pays for the copy where the copy is wanted rather than on every row for the benefit of the few that need it.

Properties

Link copied to clipboard
val key: Key

The key of the document this row is about.

Functions

Link copied to clipboard

The whole document.

Link copied to clipboard
operator fun get(index: Int): Variant?

The value of the projected field at index, in the order the projection names them.

operator fun get(name: String): Variant?

The value of the projected field name, or null where the document does not have it.

Link copied to clipboard

The row as JSON: the document itself, or an object of the projected fields.

Link copied to clipboard
open override fun toString(): String