The kotlin.time.Instant has been stabilized in Kotlin 2.3.0. The @ExperimentalTime annotation has thus been removed from all methods that use it internally (!196)
The MongoDB official driver has two main serialization modes: :bson-kotlin (based on reflection) and :bson-kotlinx (based on KotlinX.Serialization). These two systems serialize objects slightly differently.
Most notably, the newly-added types kotlin.time.Instant and kotlin.uuid.Uuid are both serialized by :bson-kotlinx as strings, but are serialized to the corresponding BSON type by :bson-kotlin.
This release introduces the serializers InstantAsBsonDatetimeSerializer and UuidAsBsonBinarySerializer which use the BSON type no matter what serialization library is used, but also support JSON serialization as strings.
Users have to enable them explicitly (see their documentation to learn how).
In this version, we also ensured that the KtMongo types (ObjectId and Timestamp) are serialized correctly using both serialization strategies.