Kotlin BSON • Multiplatform abstraction for different BSON implementations • opensavvy.ktmongo.bson • BsonValueReader
BsonValueReader¶
@LowLevelApi
interface BsonValueReader
Representation of a BSON value.
See the type to know which accessor to use. All other accessors will fail with a BsonReaderException.
To obtain instances of this interface, see BsonDocumentReader.read and BsonArrayReader.read.
Implementation constraints¶
Different implementations of BsonValueReader should be considered equal if they represent the same value, with the same type. That is, both values would result in the exact same BSON sent over the wire. The methods BsonValueReader.Companion.equals and BsonValueReader.Companion.hashCode are provided to facilitate implementation.
Types¶
Companion¶
object Companion
Properties¶
type¶
The type of this value.
Functions¶
diff¶
@LowLevelApi
infix fun BsonValueReader.diff(other: BsonValueReader): String?
Analyzes the difference between two BSON values.
read¶
Reads this reader into an instance of type.
readArray¶
@LowLevelApi
abstract fun readArray(): BsonArrayReader
readBinaryData¶
@LowLevelApi
abstract fun readBinaryData(): ByteArray
readBinaryDataType¶
@LowLevelApi
abstract fun readBinaryDataType(): UByte
readBoolean¶
@LowLevelApi
abstract fun readBoolean(): Boolean
readDateTime¶
@LowLevelApi
abstract fun readDateTime(): Long
readDBPointerId¶
@LowLevelApi
abstract fun readDBPointerId(): ByteArray
readDBPointerNamespace¶
@LowLevelApi
abstract fun readDBPointerNamespace(): String
readDecimal128¶
@LowLevelApi
abstract fun readDecimal128(): ByteArray
readDocument¶
@LowLevelApi
abstract fun readDocument(): BsonDocumentReader
readDouble¶
@LowLevelApi
abstract fun readDouble(): Double
readInstant¶
@ExperimentalTime
@LowLevelApi
open fun readInstant(): Instant
Reads an Instant. Conversion function on top of readDateTime.
readInt32¶
readInt64¶
readJavaScript¶
@LowLevelApi
abstract fun readJavaScript(): String
readJavaScriptWithScope¶
@LowLevelApi
abstract fun readJavaScriptWithScope(): String
readMaxKey¶
@LowLevelApi
abstract fun readMaxKey()
readMinKey¶
@LowLevelApi
abstract fun readMinKey()
readNull¶
@LowLevelApi
abstract fun readNull()
readObjectId¶
@ExperimentalTime
@LowLevelApi
abstract fun readObjectId(): ObjectId
readObjectIdBytes¶
@LowLevelApi
abstract fun readObjectIdBytes(): ByteArray
readRegularExpressionOptions¶
@LowLevelApi
abstract fun readRegularExpressionOptions(): String
readRegularExpressionPattern¶
@LowLevelApi
abstract fun readRegularExpressionPattern(): String
readString¶
@LowLevelApi
abstract fun readString(): String
readSymbol¶
@LowLevelApi
abstract fun readSymbol(): String
readTimestamp¶
@LowLevelApi
abstract fun readTimestamp(): Timestamp
readUndefined¶
@LowLevelApi
abstract fun readUndefined()
toString¶
JSON representation of this value.