BsonValueWriter

Generator of BSON values.

This interface is used to write a generic BSON value. For example, the root BSON value, or a specific value of a field.

To write fields in a BSON document, see BsonFieldWriter.

Instances of this interface are commonly obtained by calling the BsonContext.buildArray function.

Functions

Link copied to clipboard

Writes the arbitrary obj into this writer.

Link copied to clipboard
abstract fun writeArray(block: BsonValueWriter.() -> Unit)
Link copied to clipboard
abstract fun writeBinaryData(type: UByte, data: ByteArray)
Link copied to clipboard
abstract fun writeBoolean(value: Boolean)
Link copied to clipboard
abstract fun writeDateTime(value: Long)
Link copied to clipboard
abstract fun writeDBPointer(namespace: String, id: ByteArray)
Link copied to clipboard
abstract fun writeDecimal128(low: Long, high: Long)
Link copied to clipboard
abstract fun writeDocument(block: BsonFieldWriter.() -> Unit)
Link copied to clipboard
abstract fun writeDouble(value: Double)
Link copied to clipboard

Writes an Instant. Conversion function on top of writeDateTime.

Link copied to clipboard
open fun writeInt32(value: Byte)
abstract fun writeInt32(value: Int)
open fun writeInt32(value: Short)
Link copied to clipboard
abstract fun writeInt64(value: Long)
Link copied to clipboard
abstract fun writeJavaScript(code: String)
Link copied to clipboard
Link copied to clipboard
abstract fun writeMaxKey()
Link copied to clipboard
abstract fun writeMinKey()
Link copied to clipboard
abstract fun writeNull()
Link copied to clipboard
Link copied to clipboard
abstract fun <T> writeObjectSafe(obj: T)

Writes an arbitrary obj into a BSON document.

Link copied to clipboard
abstract fun writeRegularExpression(pattern: String, options: String)
Link copied to clipboard
abstract fun writeString(value: String)
Link copied to clipboard
abstract fun writeSymbol(value: String)
Link copied to clipboard
abstract fun writeTimestamp(value: Timestamp)
Link copied to clipboard