Kotlin BSON • Multiplatform abstraction for different BSON implementations • opensavvy.ktmongo.bson • Bson
Bson¶
interface Bson
A BSON document.
To create instances of this class, see BsonFactory.
Implementation constraints¶
equals and hashCode should follow the same constraints as BsonDocumentReader's implementations.
Functions¶
at¶
Finds the first value that matches path in a given BSON document.
diff¶
Analyzes the difference between two BSON documents.
read¶
Reads this document into an instance of type T.
reader¶
@LowLevelApi
abstract fun reader(): BsonDocumentReader
Reads the fields of this document.
select¶
Finds all values that match path in a given BSON document.
Finds all values that match path in a given BSON document.
selectFirst¶
inline fun <T> Bson.selectFirst(@Language
(value = "JSONPath") path: String): T
Finds the first value that matches path in a given BSON document.
inline fun <T> Bson.selectFirst(path: BsonPath): T
Finds the first value that matches path in a given BSON document.
toByteArray¶
@LowLevelApi
abstract fun toByteArray(): ByteArray
Low-level byte representation of this BSON document.