kmongo / org.litote.kmongo.util / KMongoUtil

KMongoUtil

object KMongoUtil (source)

Internal utility methods

Properties

EMPTY_JSON

const val EMPTY_JSON: String

Functions

defaultCollectionName

fun defaultCollectionName(clazz: KClass<*>): String

encodeValue

fun <TItem : Any> encodeValue(writer: BsonDocumentWriter, value: TItem?, codecRegistry: CodecRegistry): Unit

extractId

fun extractId(obj: Any, clazz: KClass<*>): Any

filterIdToBson

fun filterIdToBson(obj: Any, filterNullProperties: Boolean = false): BsonDocument

formatJson

fun formatJson(json: String): String

generateNewIdforIdClass

fun generateNewIdforIdClass(idClass: KClass<out Any>): Any

getIdBsonValue

fun getIdBsonValue(idValue: Any?): BsonValue?

getIdValue

fun getIdValue(value: Any): Any?

idFilterQuery

fun idFilterQuery(id: Any): Bson

setModifier

fun setModifier(obj: Any, updateOnlyNotNullProperties: Boolean = false): Bson

toBson

fun toBson(json: String): BsonDocument
fun <T : Any> toBson(json: String, type: KClass<T>): BsonDocument

toBsonList

fun toBsonList(json: Array<out String>, codecRegistry: CodecRegistry): List<Bson>

toBsonModifier

fun toBsonModifier(obj: Any, updateOnlyNotNullProperties: Boolean = false): Bson

toExtendedJson

fun toExtendedJson(obj: Any): String

toWriteModel

fun <T : Any> toWriteModel(json: Array<out String>, codecRegistry: CodecRegistry, type: KClass<T>): List<WriteModel<BsonDocument>>