Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5276

Ability to configure BsonConfiguration for default KotlinSerializerCodecProvider

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Fixed
    • Icon: Unknown Unknown
    • 5.0.0
    • None
    • Kotlin
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      When I follow this article to configure the driver with kotlinx-serialization integration, it creates `KotlinSerializerCodecProvider` by default (code) and there's no way to configure BsonConfiguration (code1, code2).

       

      We are planning to migrate the kotlin mongo library from KMongo to the kotlin driver, and we need to configure BsonConfiguration because the `classDiscriminator` was `___type` and now its `_t` for the BsonConfiguration default instance.

       

      We can work around this situation by manually ignoring KotlinCodecProvier while building MongoClientSettings, but it's better if we can configure the default BsonConfiguration directly.

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            jun.tomioka@wolt.com Jun Tomioka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: