Skip to content

opensavvy.ktmongo.bson

Utilities and primitives to read and write BSON documents.

opensavvy.ktmongo.bson.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

AnyBsonWriter

@LowLevelApi
sealed interface AnyBsonWriter

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

BsonArray

A BSON array.

BsonDecodingException

class BsonDecodingException(message: String, cause: Throwable? = null) : IllegalStateException

Exception thrown when decoding a BsonValue fails.

BsonDocument

A BSON document.

BsonEncodingException

class BsonEncodingException(message: String, cause: Throwable? = null) : IllegalStateException

Exception thrown when encoding a BsonValue fails.

BsonFactory

interface BsonFactory

Entrypoint for creating BsonDocument and BsonArray instances.

BsonFieldWriteable

interface BsonFieldWriteable

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

BsonFieldWriter

Generator of BSON document fields.

BsonPath

sealed interface BsonPath

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

BsonType

The different data types supported in BSON documents.

BsonValue

An arbitrary BSON value.

BsonValueWriteable

interface BsonValueWriteable

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

BsonValueWriter

Generator of BSON values.

BsonWriterDsl

@DslMarker
annotation class BsonWriterDsl

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

ExperimentalBsonDiffApi

@RequiresOptIn(message = "This method is part of an experimental API to analyse the difference between BSON objects. Please share your feedback in https://gitlab.com/opensavvy/ktmongo/-/issues/98")
annotation class ExperimentalBsonDiffApi

ExperimentalBsonPathApi

@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.TYPEALIAS, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FUNCTION])
@RequiresOptIn(message = "This symbol is part of the experimental BsonPath API. It may change or be removed without warnings. Please provide feedback in https://gitlab.com/opensavvy/ktmongo/-/issues/93.")
annotation class ExperimentalBsonPathApi

Properties

DEPRECATED_IN_BSON_SPEC

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

Functions