BsonArray¶
@Serializable(with = BsonArray.Serializer::class)
@Serializable(with = BsonArray.Serializer::class)
expect class BsonArray : BsonArray
Implementation of opensavvy.ktmongo.bson.BsonArray based on the official MongoDB drivers.
To create instances of this class, see [`BsonFactory`](../../../bson/opensavvy.ktmongo.bson/-bson-factory/index.md).
<blockquote markdown>
This page describes the BSON implementation based on the official MongoDB drivers. To learn more about the general BSON operations, see [`opensavvy.ktmongo.bson.BsonArray`](../../../bson/opensavvy.ktmongo.bson/-bson-array/index.md).
</blockquote>
### Navigating BSON types
This interface is part of the BSON trinity:
- [`BsonDocument`](../-bson-document/index.md) represents an entire BSON document.
- [`BsonArray`](index.md) represents an array of BSON values.
- [`BsonValue`](../-bson-value/index.md) represents a single value in isolation.
### Usage
```kotlin
val bson: BsonArray = …
for (element in bson) {
println("Element: $element")
}
```
@Serializable(with = BsonArray.Serializer::class)
@Serializable(with = BsonArray.Serializer::class)
actual class BsonArray : BsonArray
opensavvy.ktmongo.bson.BsonArray that wraps a org.bson.BsonArray.
To create an instance of this class, see BsonFactory.readArray.
Types¶
Serializer¶
expect object Serializer : KSerializer<BsonArray>
actual object Serializer : KSerializer<BsonArray>
Serializer for the official opensavvy.ktmongo.bson.official.BsonArray implementation.
Properties¶
factory¶
expect open override val factory: BsonFactory
actual open override val factory: BsonFactory
indices¶
lastIndex¶
raw¶
val raw: BsonArray
size¶
Functions¶
asIterable¶
expect open override fun asIterable(): Iterable<BsonValue>
actual open override fun asIterable(): Iterable<BsonValue>
asList¶
asSequence¶
expect open override fun asSequence(): Sequence<BsonValue>
actual open override fun asSequence(): Sequence<BsonValue>
asValue¶
decode¶
@LowLevelApi
abstract fun <T> decode(type: KType): T
@LowLevelApi
open override fun <T> decode(type: KType): T
decodeElements¶
@LowLevelApi
open fun <T> decodeElements(type: KType): List<T>
@LowLevelApi
open fun <T> decodeElements(type: KType): List<T>
equals¶
get¶
hashCode¶
isEmpty¶
isNotEmpty¶
open fun isNotEmpty(): Boolean
open fun isNotEmpty(): Boolean
iterator¶
toString¶
withIndex¶
expect open override fun withIndex(): Iterable<IndexedValue<BsonValue>>
actual open override fun withIndex(): Iterable<IndexedValue<BsonValue>>