Bson

interface Bson(source)

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

Link copied to clipboard
infix inline fun <T> Bson.at(path: BsonPath): T

Finds the first value that matches path in a given BSON document.

Link copied to clipboard
infix fun Bson.diff(other: Bson): String?

Analyzes the difference between two BSON documents.

Link copied to clipboard
inline fun <T : Any> Bson.read(): T?

Reads this document into an instance of type T.

Link copied to clipboard

Reads the fields of this document.

Link copied to clipboard
inline fun <T> Bson.select(@Language(value = "JSONPath") path: String): Sequence<T>
inline fun <T> Bson.select(path: BsonPath): Sequence<T>

Finds all values that match path in a given BSON document.

Link copied to clipboard
inline fun <T> Bson.selectFirst(@Language(value = "JSONPath") path: String): T
inline fun <T> Bson.selectFirst(path: BsonPath): T

Finds the first value that matches path in a given BSON document.

Link copied to clipboard

Low-level byte representation of this BSON document.

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

JSON representation of this Bson object, as a String.