BsonContext¶
interface BsonContext : BsonFactory, ObjectIdGenerator, PropertyNameStrategy
BSON configuration for the objects generated by the DSL.
This object is passed through the entire DSL to allow accessing the configuration from anywhere during request generation.
Constructors¶
BsonContext¶
@ExperimentalAtomicApi
fun BsonContext(
bsonFactory: BsonFactory,
objectIdGenerator: ObjectIdGenerator = ObjectIdGenerator.Default(),
nameStrategy: PropertyNameStrategy = PropertyNameStrategy.Default
): BsonContext
BSON configuration for the objects generated by the DSL.
Functions¶
buildArray¶
@LowLevelApi
abstract fun buildArray(block: BsonValueWriter.() -> Unit): BsonArray
@LowLevelApi
open fun buildArray(instance: BsonValueWriteable): BsonArray
buildDocument¶
@LowLevelApi
abstract fun buildDocument(block: BsonFieldWriter.() -> Unit): Bson
@LowLevelApi
open fun buildDocument(instance: BsonFieldWriteable): Bson
newId¶
pathOf¶
@LowLevelApi
abstract fun pathOf(property: KProperty1<*, *>): Path
Generates the name of a property.
readArray¶
readDocument¶
@LowLevelApi
abstract fun readDocument(bytes: ByteArray): Bson