Package-level declarations

Utilities and primitives to read and write BSON documents.

Bson and BsonArray respectively represent BSON documents and arrays.

BsonFactory is the entry point to create new BSON documents.

BsonPath provides a convenient way to search for data in a complex BSON document.

Types

Link copied to clipboard
sealed interface AnyBsonWriter

Parent interface for type parameters that can accept either BsonValueWriter or BsonFieldWriter.

Link copied to clipboard
interface Bson

A BSON document.

Link copied to clipboard
interface BsonArray

A BSON array.

Link copied to clipboard

Utilities for decomposing a BsonArray into its elements.

Link copied to clipboard

Utilities for decomposing a Bson document into its fields.

Link copied to clipboard
interface BsonFactory

Entrypoint for creating Bson and BsonArray instances.

Link copied to clipboard

An object that can be represented as fields in a BSON document.

Link copied to clipboard

Generator of BSON document fields.

Link copied to clipboard
sealed interface BsonPath

Access specific fields in arbitrary BSON documents using a JSONPath-like API.

Link copied to clipboard
class BsonReaderException(message: String, cause: Throwable? = null) : IllegalStateException

Exception thrown when BSON reading fails.

Link copied to clipboard

The different data types supported in BSON documents.

Link copied to clipboard

Representation of a BSON value.

Link copied to clipboard

An object that can be represented as a BSON value (value of a field, item in an array, an array itself).

Link copied to clipboard

Generator of BSON values.

Link copied to clipboard
annotation class BsonWriterDsl

Annotation to mark types that are part of the BSON writer DSL.

Link copied to clipboard
annotation class ExperimentalBsonDiffApi
Link copied to clipboard
annotation class ExperimentalBsonPathApi

Properties

Link copied to clipboard

Deprecation messages for BSON functionality that is deprecated in the BSON spec.

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
fun BsonPath(@Language(value = "JSONPath") text: String): BsonPath

Parses an RFC-9535 compliant string expression into a BsonPath instance.

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

Analyzes the difference between two BSON documents.

infix fun BsonArray.diff(other: BsonArray): String?

Analyzes the difference between two BSON arrays.

Analyzes the difference between two BSON values.

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

Reads this document into an instance of type T.

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
inline fun <T : Any> BsonFactory.write(obj: T): Bson

Writes an arbitrary Kotlin obj into a top-level BSON document.