Skip to content

BsonArray

Pure Kotlin implementation of opensavvy.ktmongo.bson.BsonArray.

To create instances of this class, see BsonFactory.

This page describes the BSON multiplatform implementation. To learn more about the general BSON operations, see opensavvy.ktmongo.bson.BsonArray.

This class is part of the BSON trinity:

Usage

val bson: BsonArray = 

for (element in bson) {
    println("Element: $element")
}

Thread-safety

This class is not thread-safe. Although it is not possible to mutate its state, this class uses internal mutation to lazily decode the BSON stream.

Types

Serializer

Serializer for the multiplatform opensavvy.ktmongo.bson.multiplatform.BsonArray implementation.

Properties

factory

open override val factory: BsonFactory

indices

open val indices: IntRange

lastIndex

open val lastIndex: Int

size

open override val size: Int

Functions

asIterable

open override fun asIterable(): Iterable<BsonValue>

asList

open override fun asList(): List<BsonValue>

asSequence

open override fun asSequence(): Sequence<BsonValue>

asValue

open override fun asValue(): BsonValue

decode

@ExperimentalSerializationApi
@LowLevelApi
open override fun <T> decode(type: KType): T

decodeElements

@LowLevelApi
open fun <T> decodeElements(type: KType): List<T>

equals

open operator override fun equals(other: Any?): Boolean

get

open operator override fun get(index: Int): BsonValue?

hashCode

open override fun hashCode(): Int

isEmpty

open override fun isEmpty(): Boolean

isNotEmpty

open fun isNotEmpty(): Boolean

iterator

open operator override fun iterator(): Iterator<BsonValue>

toString

open override fun toString(): String

withIndex

open override fun withIndex(): Iterable<IndexedValue<BsonValue>>