IndexUpdater

ENTERPRISE EDITION API

IndexUpdater used for updating the index in lazy mode. Currently, the vector index is the only index type that can be updated lazily.

Note!!

The finish function implicitly closes the IndexUpdater if it succeeds. Use of a closed IndexUpdater or any container (Dictionary or Array) obtained from it will throw a CouchbaseLiteError.

Properties

Link copied to clipboard
abstract override val count: Int

The number of the items in the array.

Functions

Link copied to clipboard
abstract override fun close()

Close the updater without a checked exception

Link copied to clipboard
abstract fun finish()

Updates the index with the computed vectors and removes any index rows for which null vector was given. If there are any indexes that do not have their vector value set or are skipped, a CouchbaseLiteException will be thrown.

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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract override fun getBoolean(index: Int): Boolean

Gets value at the given index as a boolean.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract override fun getDictionary(index: Int): Dictionary?

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

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract operator fun iterator(): Iterator<Any?>
Link copied to clipboard
abstract fun setVector(value: List<Float>?, index: Int)

Sets the vector for the value corresponding to the index. Setting null value means that there is no vector for the value, and any existing vector will be removed when the finish() is called.

Link copied to clipboard
abstract fun skipVector(index: Int)

Skip setting the vector for the value corresponding to the index. The vector will be required to compute and set again for the value when the QueryIndex's beginUpdate() is later called for updating the index.

Link copied to clipboard
abstract override fun toJSON(): String

Encode an Array as a JSON string

Link copied to clipboard
abstract 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.