mongoClient

@ExperimentalKBsonSerializerApi
abstract fun mongoClient(serviceName: String, eJson: EJson? = null): MongoClient

Get a MongoClient for accessing documents from App Service's Data Source.

Serialization to and from EJSON is performed with KBSON that supports the Kotlin Serialization framework and handles serialization to and from classes marked with Serializable. Serialization of realm objects and links have some caveats and requires special configuration. For full details see MongoClient.

Parameters

serviceName

the name of the data service.

eJson

the EJson serializer that the MongoClient should use to convert objects and primary keys with. Will default to the app's EJson instance configured with AppConfiguration.Builder.ejson. For details on configuration of serialization see MongoClient. throws IllegalStateException if trying to obtain a MongoClient from a logged out User.