Docs Menu
Docs Home
/ / /
Kotlin Sync Driver

What's New

On this page

  • What's New in 5.2
  • What's New in 5.1.3
  • What's New in 5.1.2
  • What's New in 5.1.1
  • What's New in 5.1
  • What's New in 5.0

Learn what's new in:

  • Version 5.2

  • Version 5.1.3

  • Version 5.1.2

  • Version 5.1.1

  • Version 5.1

  • Version 5.0

Important

Removal of Support for MongoDB Server 3.6

Kotlin Sync driver v5.2 removes support for MongoDB Server 3.6. To learn more about compatible versions of the server, see Compatibility.

The 5.2 driver release includes the following new features, improvements, and fixes:

  • Adds support for serializers from the kotlinx-datetime library that let you map Kotlin date and time types to BSON as the expected types instead of as strings. To learn more, see the Serialize Dates and Times section of the Kotlin Serialization guide.

  • Supports serialization of JsonElement values. To work with the JsonElement type, you must add the kotlinx-serialization-json library as a dependency in your application.

The 5.1.3 driver patch release includes the following changes:

The 5.1.2 driver patch release includes the following changes:

  • Support for encoding Kotlin data classes with nullable generic parameter types. For example, you can encode the Container class in the following code:

    @Serializable
    data class Box<T>(
    val boxed: T
    )
    @Serializable
    data class Container(
    val box: Box<String?>
    )

The 5.1.1 driver patch release includes the following changes:

  • When using the MONGODB-OIDC authentication mechanism, you must not include comma characters in the authMechanismProperties connection string value.

Warning

Deprecations in this release

To avoid breaking changes in future major releases of the driver, replace any application code that depends on deprecated program elements.

This section includes the following information:

  • Support for MongoDB Server v3.6 is deprecated and will be removed in the next driver version release. To learn how to upgrade your MongoDB Server deployment, see Release Notes in the MongoDB Server manual.

  • Internal testing of GraalVM native image technology. These tests involve building native applications by using the GraalVM native-image tool.

  • Enhanced support for the MONGODB-OIDC authentication mechanism.

  • Fixes an issue in which operations used the incorrect codec when using a polymorphic MongoCollection instance. This ensures that discriminator information is not lost when using bson-kotlinx.

  • Fixes an issue in which the class discriminator was the first field when decoding, resulting in field type errors when using a polymorphic MongoCollection instance.

New features of the 5.0 driver release include:

  • The KotlinSerializerCodecProvider constructor now accepts serializersModule and bsonConfiguration objects:

    KotlinSerializerCodec.create(clazz.kotlin, serializersModule=serializersModule, bsonConfiguration=bsonConfiguration)

    This makes it easier to customize your configuration.

  • Fixes a Kotlin reflection bug that resulted in container type erasure.

Back