BsonArray

class BsonArray(initial: List<BsonValue>) : BsonValue, MutableList<BsonValue>

A type-safe representation of the BSON array type.

Parameters

initial

the initial list of BsonValues in the array

Constructors

Link copied to clipboard
fun BsonArray(initialCapacity: Int)

Construct an empty BsonArray with the specified initial capacity.

Link copied to clipboard
fun BsonArray(initial: List<BsonValue> = emptyList())

constructs the bson array with an initial list of values, defaults to no items

Functions

Link copied to clipboard
open override fun add(element: BsonValue): Boolean
open override fun add(index: Int, element: BsonValue)
Link copied to clipboard
open override fun addAll(elements: Collection<BsonValue>): Boolean
open override fun addAll(index: Int, elements: Collection<BsonValue>): Boolean
Link copied to clipboard
fun asArray(): BsonArray

Gets this value as a BsonArray if it is one, otherwise throws exception

Link copied to clipboard
fun asBinary(): BsonBinary

Gets this value as a BsonBinary if it is one, otherwise throws exception

Link copied to clipboard
fun asBoolean(): BsonBoolean

Gets this value as a BsonBoolean if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonMaxKey(): BsonMaxKey

Gets this value as a BsonMaxKey if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonMinKey(): BsonMinKey

Gets this value as a BsonMinKey if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonNull(): BsonNull

Gets this value as a BsonNull if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonUndefined(): BsonUndefined

Gets this value as a BsonUndefined if it is one, otherwise throws exception

Link copied to clipboard
fun asDateTime(): BsonDateTime

Gets this value as a BsonDateTime if it is one, otherwise throws exception

Link copied to clipboard
fun asDBPointer(): BsonDBPointer

Gets this value as a BsonDBPointer if it is one, otherwise throws exception

Link copied to clipboard
fun asDecimal128(): BsonDecimal128

Gets this value as a BsonDecimal128 if it is one, otherwise throws exception

Link copied to clipboard
fun asDocument(): BsonDocument

Gets this value as a BsonDocument if it is one, otherwise throws exception

Link copied to clipboard
fun asDouble(): BsonDouble

Gets this value as a BsonDouble if it is one, otherwise throws exception

Link copied to clipboard
fun asInt32(): BsonInt32

Gets this value as a BsonInt32 if it is one, otherwise throws exception

Link copied to clipboard
fun asInt64(): BsonInt64

Gets this value as a BsonInt64 if it is one, otherwise throws exception

Link copied to clipboard
fun asJavaScript(): BsonJavaScript

Gets this value as a BsonJavaScript if it is one, otherwise throws exception

Link copied to clipboard
fun asJavaScriptWithScope(): BsonJavaScriptWithScope

Gets this value as a BsonJavaScriptWithScope if it is one, otherwise throws exception

Link copied to clipboard
fun asNumber(): BsonNumber

Gets this value as a BsonNumber if it is one, otherwise throws exception

Link copied to clipboard
fun asObjectId(): BsonObjectId

Gets this value as an BsonObjectId if it is one, otherwise throws exception

Link copied to clipboard
fun asRegularExpression(): BsonRegularExpression

Gets this value as a BsonRegularExpression if it is one, otherwise throws exception

Link copied to clipboard
fun asString(): BsonString

Gets this value as a BsonString if it is one, otherwise throws exception

Link copied to clipboard
fun asSymbol(): BsonSymbol

Gets this value as a BsonSymbol if it is one, otherwise throws exception

Link copied to clipboard
fun asTimestamp(): BsonTimestamp

Gets this value as a BsonTimestamp if it is one, otherwise throws exception

Link copied to clipboard
open override fun clear()
Link copied to clipboard
fun clone(): BsonArray

Creates and returns a deep copy of this object

Link copied to clipboard
open operator override fun contains(element: BsonValue): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<BsonValue>): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open operator override fun get(index: Int): BsonValue
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun indexOf(element: BsonValue): Int
Link copied to clipboard
fun isArray(): Boolean
Link copied to clipboard
fun isBinary(): Boolean
Link copied to clipboard
fun isBoolean(): Boolean
Link copied to clipboard
fun isDateTime(): Boolean
Link copied to clipboard
fun isDBPointer(): Boolean
Link copied to clipboard
fun isDecimal128(): Boolean
Link copied to clipboard
fun isDocument(): Boolean
Link copied to clipboard
fun isDouble(): Boolean
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
fun isInt32(): Boolean
Link copied to clipboard
fun isInt64(): Boolean
Link copied to clipboard
fun isJavaScript(): Boolean
Link copied to clipboard
fun isJavaScriptWithScope(): Boolean
Link copied to clipboard
fun isMaxKey(): Boolean
Link copied to clipboard
fun isMinKey(): Boolean
Link copied to clipboard
fun isNull(): Boolean
Link copied to clipboard
fun isNumber(): Boolean
Link copied to clipboard
fun isObjectId(): Boolean
Link copied to clipboard
fun isRegularExpression(): Boolean
Link copied to clipboard
fun isString(): Boolean
Link copied to clipboard
fun isSymbol(): Boolean
Link copied to clipboard
fun isTimestamp(): Boolean
Link copied to clipboard
fun isUndefined(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<BsonValue>
Link copied to clipboard
open override fun lastIndexOf(element: BsonValue): Int
Link copied to clipboard
open override fun listIterator(): MutableListIterator<BsonValue>
open override fun listIterator(index: Int): MutableListIterator<BsonValue>
Link copied to clipboard
open override fun remove(element: BsonValue): Boolean
Link copied to clipboard
open override fun removeAll(elements: Collection<BsonValue>): Boolean
Link copied to clipboard
open override fun removeAt(index: Int): BsonValue
Link copied to clipboard
open override fun retainAll(elements: Collection<BsonValue>): Boolean
Link copied to clipboard
open operator override fun set(index: Int, element: BsonValue): BsonValue
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<BsonValue>
Link copied to clipboard
fun toJson(): String

Return an extended json representation of this BsonValue

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

Properties

Link copied to clipboard
open override val bsonType: BsonType

Gets the BSON type of this value.

Link copied to clipboard
open override val size: Int
Link copied to clipboard
val values: List<BsonValue>

The values in this array as a list of BsonValue objects.