Result

Result represents a row of result set returned by a Query.

A Result may be referenced only while the ResultSet that contains it is open. An attempt to reference a Result after calling ResultSet.close on the ResultSet that contains it will throw a CouchbaseLiteError

actual class Result : DelegatedClass<<Error class: unknown class>> , ArrayInterface, DictionaryInterface, Iterable<String> (source)

Properties

Link copied to clipboard
actual open override val count: Int
expect open override val count: Int

The number of the values in the result.

actual open override val count: Int

The number of the items in the array.

actual open override val count: Int
Link copied to clipboard
actual open override val keys: List<String>
expect open override val keys: List<String>

A list of keys

actual open override val keys: List<String>

A List containing all keys, or an empty List if the dictionary has no properties.

actual open override val keys: List<String>

Functions

Link copied to clipboard
actual open operator override fun contains(key: String): Boolean
expect open operator override fun contains(key: String): Boolean

Tests whether key exists or not.

actual open operator override fun contains(key: String): Boolean

Tests whether a property exists or not. This can be less expensive than getValue(String), because it does not have to allocate an Object for the property value.

actual open operator override fun contains(key: String): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun ArrayInterface.get(index: Int): Fragment

Subscript access to a Fragment object of the projecting result value at the given index.

Subscript access to a Fragment object of the projecting result value for the given key.

Link copied to clipboard
actual open override fun getArray(index: Int): Array?
actual open override fun getArray(key: String): Array?
expect open override fun getArray(index: Int): Array?

The result at the given index interpreted as an Array. Returns null if the value cannot be so interpreted.

expect open override fun getArray(key: String): Array?

The result value for the given key as a Array Returns null if the key doesn't exist or if the value is not an Array

actual open override fun getArray(index: Int): Array?

Gets value at the given index as an Array. Returns null if the value doesn't exist, or its value is not an Array.

actual open override fun getArray(key: String): Array?

Get a property's value as an Array. Returns null if the property doesn't exist, or its value is not an array.

actual open override fun getArray(index: Int): Array?
actual open override fun getArray(key: String): Array?
Link copied to clipboard
actual open override fun getBlob(index: Int): Blob?
actual open override fun getBlob(key: String): Blob?
expect open override fun getBlob(index: Int): Blob?

The result at the given index interpreted as a Blob. Returns null if the value cannot be so interpreted.

expect open override fun getBlob(key: String): Blob?

The result value for the given key as a Blob Returns null if the key doesn't exist or if the value is not a Blob

actual open override fun getBlob(index: Int): Blob?

Gets value at the given index as a Blob. Returns null if the value doesn't exist, or its value is not a Blob.

actual open override fun getBlob(key: String): Blob?

Gets a property's value as a Blob. Returns null if the value doesn't exist, or its value is not a Blob.

actual open override fun getBlob(index: Int): Blob?
actual open override fun getBlob(key: String): Blob?
Link copied to clipboard
actual open override fun getBoolean(index: Int): Boolean
actual open override fun getBoolean(key: String): Boolean
expect open override fun getBoolean(index: Int): Boolean

The result at the given index interpreted as a boolean. Returns false if the value cannot be so interpreted.

expect open override fun getBoolean(key: String): Boolean

The result value for the given key as a boolean Returns false if the key doesn't exist or if the value is not a boolean

actual open override fun getBoolean(index: Int): Boolean

Gets value at the given index as a boolean.

actual open override fun getBoolean(key: String): Boolean

Gets a property's value as a boolean. Returns true if the value exists, and is either true or a nonzero number.

actual open override fun getBoolean(index: Int): Boolean
actual open override fun getBoolean(key: String): Boolean
Link copied to clipboard
actual open override fun getDate(index: Int): Instant?
actual open override fun getDate(key: String): Instant?
expect open override fun getDate(index: Int): Instant?

The result at the given index interpreted as an Instant date. Returns null if the value cannot be so interpreted.

expect open override fun getDate(key: String): Instant?

The result value for the given key as an Instant date Returns null if the key doesn't exist or if the value is not a date

actual open override fun getDate(index: Int): Instant?

Gets value at the given index as a Date. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns null if the value doesn't exist, is not a string, or is not parsable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds.

actual open override fun getDate(key: String): Instant?

Gets a property's value as an Instant date. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns null if the value doesn't exist, is not a string, or is not parsable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds.

actual open override fun getDate(index: Int): Instant?
actual open override fun getDate(key: String): Instant?
Link copied to clipboard
actual open override fun getDictionary(index: Int): Dictionary?
actual open override fun getDictionary(key: String): Dictionary?
expect open override fun getDictionary(index: Int): Dictionary?

The result at the given index interpreted as a Dictionary. Returns null if the value cannot be so interpreted.

expect open override fun getDictionary(key: String): Dictionary?

The result value for the given key as a Dictionary Returns null if the key doesn't exist or if the value is not a Dictionary

actual open override fun getDictionary(index: Int): Dictionary?

Gets a Dictionary at the given index. Return null if the value is not a dictionary.

actual open override fun getDictionary(key: String): Dictionary?

Get a property's value as a Dictionary. Returns null if the property doesn't exist, or its value is not a dictionary.

actual open override fun getDictionary(index: Int): Dictionary?
actual open override fun getDictionary(key: String): Dictionary?
Link copied to clipboard
actual open override fun getDouble(index: Int): Double
actual open override fun getDouble(key: String): Double
expect open override fun getDouble(index: Int): Double

The result at the given index interpreted as a double. Returns 0.0 if the value cannot be so interpreted.

expect open override fun getDouble(key: String): Double

The result value for the given key as a double Returns 0.0 if the key doesn't exist or if the value is not a double

actual open override fun getDouble(index: Int): Double

Gets value at the given index as a double. Integers will be converted to double. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the property doesn't exist or does not have a numeric value.

actual open override fun getDouble(key: String): Double

Gets a property's value as a double. Integers will be converted to double. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the property doesn't exist or does not have a numeric value.

actual open override fun getDouble(index: Int): Double
actual open override fun getDouble(key: String): Double
Link copied to clipboard
actual open override fun getFloat(index: Int): Float
actual open override fun getFloat(key: String): Float
expect open override fun getFloat(index: Int): Float

The result at the given index interpreted as a float. Returns 0.0F if the value cannot be so interpreted.

expect open override fun getFloat(key: String): Float

The result value for the given key as a float Returns 0.0F if the key doesn't exist or if the value is not a float

actual open override fun getFloat(index: Int): Float

Gets value at the given index as a float. Integers will be converted to float. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the value doesn't exist or does not have a numeric value.

actual open override fun getFloat(key: String): Float

Gets a property's value as a float. Integers will be converted to float. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the value doesn't exist or does not have a numeric value.

actual open override fun getFloat(index: Int): Float
actual open override fun getFloat(key: String): Float
Link copied to clipboard
actual open override fun getInt(index: Int): Int
actual open override fun getInt(key: String): Int
expect open override fun getInt(index: Int): Int

The result at the given index interpreted as and an int. Returns 0 if the value cannot be so interpreted.

expect open override fun getInt(key: String): Int

The result value for the given key as an int Returns 0 if the key doesn't exist or if the value is not a int

actual open override fun getInt(index: Int): Int

Gets value at the given index as an int. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

actual open override fun getInt(key: String): Int

Gets a property's value as an int. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

actual open override fun getInt(index: Int): Int
actual open override fun getInt(key: String): Int
Link copied to clipboard
actual open override fun getLong(index: Int): Long
actual open override fun getLong(key: String): Long
expect open override fun getLong(index: Int): Long

The result at the given index interpreted as a long. Returns 0 if the value cannot be so interpreted.

expect open override fun getLong(key: String): Long

The result value for the given key as a long Returns 0L if the key doesn't exist or if the value is not a long

actual open override fun getLong(index: Int): Long

Gets value at the given index as a long. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

actual open override fun getLong(key: String): Long

Gets a property's value as a long. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

actual open override fun getLong(index: Int): Long
actual open override fun getLong(key: String): Long
Link copied to clipboard
actual open override fun getNumber(index: Int): Number?
actual open override fun getNumber(key: String): Number?
expect open override fun getNumber(index: Int): Number?

The result at the given index interpreted as a Number. Returns null if the value cannot be so interpreted.

expect open override fun getNumber(key: String): Number?

The result value for the given key as a Number Returns null if the key doesn't exist or if the value is not a Number

actual open override fun getNumber(index: Int): Number?

Gets value at the given index as a Number. Returns null if the value doesn't exist, or its value is not a Number.

actual open override fun getNumber(key: String): Number?

Gets a property's value as a Number. Returns null if the value doesn't exist, or its value is not a Number.

actual open override fun getNumber(index: Int): Number?
actual open override fun getNumber(key: String): Number?
Link copied to clipboard
actual open override fun getString(index: Int): String?
actual open override fun getString(key: String): String?
expect open override fun getString(index: Int): String?

The result at the given index converted to a String

expect open override fun getString(key: String): String?

The result value for the given key as a String Returns null if the key doesn't exist.

actual open override fun getString(index: Int): String?

Gets value at the given index as a String. Returns null if the value doesn't exist, or its value is not a String.

actual open override fun getString(key: String): String?

Gets a property's value as a String. Returns null if the value doesn't exist, or its value is not a String.

actual open override fun getString(index: Int): String?
actual open override fun getString(key: String): String?
Link copied to clipboard
actual open override fun getValue(index: Int): Any?
actual open override fun getValue(key: String): Any?
expect open override fun getValue(index: Int): Any?

The result value at the given index.

expect open override fun getValue(key: String): Any?

The result value for the given key as an Object Returns null if the key doesn't exist.

actual open override fun getValue(index: Int): Any?

Gets value at the given index as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or null if the value is null.

actual open override fun getValue(key: String): Any?

Gets a property's value as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or null if the property value is null or the property doesn't exist.

actual open override fun getValue(index: Int): Any?
actual open override fun getValue(key: String): Any?
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
Link copied to clipboard
actual open operator override fun iterator(): Iterator<String>
expect open operator override fun iterator(): Iterator<String>

Gets an iterator over the result's keys.

actual open operator override fun iterator(): Iterator<String>
actual open operator override fun iterator(): Iterator<String>
Link copied to clipboard
actual open override fun toJSON(): String
expect open override fun toJSON(): String

Encode a Result as a JSON string

actual open override fun toJSON(): String

Encode an Array as a JSON string

actual open override fun toJSON(): String
Link copied to clipboard
actual open override fun toList(): List<Any?>
expect open override fun toList(): List<Any?>

Gets all the values as a List. The types of the values contained in the returned List are Array, Blob, Dictionary, Number types, String, and null.

actual open override fun toList(): List<Any?>

Gets content of the current object as a List. The values contained in the returned List object are all JSON based values.

actual open override fun toList(): List<Any?>
Link copied to clipboard
actual open override fun toMap(): Map<String, Any?>
expect open override fun toMap(): Map<String, Any?>

Gets all values as a Map. The keys in the returned map are the names of columns that have values. The types of the values are Array, Blob, Dictionary, Number types, String, and null.

actual open override fun toMap(): Map<String, Any?>

Gets content of the current object as a Map. The values contained in the returned Map object are all JSON based values.

actual open override fun toMap(): Map<String, Any?>
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String