@@ -313,9 +313,9 @@ work with date and time types.
313313kotlinx-datetime Library
314314~~~~~~~~~~~~~~~~~~~~~~~~
315315
316- ``kotlinx-datetime`` is a {+language+} library that allows
317- you to work with dates and times. If you want a high level of control
318- over how your date and time values are serialized, you can add the
316+ ``kotlinx-datetime`` is a {+language+} library that offers
317+ a high level of control over how your date and time values
318+ are serialized. To use the library, add the ``kotlinx-datetime``
319319dependency to your project's dependency list.
320320
321321Select from the following tabs to see how to add the ``kotlinx-datetime``
@@ -354,11 +354,17 @@ After you add the library dependency, you can implement serializers from
354354the ``kotlinx-datetime`` library that map your data class field values
355355to the expected types in BSON.
356356
357- The following ``Appointment`` data class has the ``@Serializable``
358- annotation and the ``@Contextual`` annotation on the ``date`` field
359- to use the ``kotlinx-datetime`` serializer for ``LocalDate`` values.
360- Values of the ``time`` field are stored as strings, because the driver
361- does not use a serializer without the ``@Contextual`` annotation:
357+ In the following example, the driver serializes the fields of
358+ the ``Appointment`` data class with the following behavior:
359+
360+ - ``name``: The driver serializes the value as a string.
361+
362+ - ``date``: The driver uses the ``kotlinx-datetime`` serializer
363+ because the field has the ``@Contextual`` annotation. So,
364+ ``LocalDate`` values are serialized as BSON dates.
365+
366+ - ``time``: The driver serializes the value as a string because it does
367+ not have the ``@Contextual`` annotation.
362368
363369.. literalinclude:: /examples/generated/KotlinXSerializationTest.snippet.datetime-data-class.kt
364370 :language: kotlin
@@ -370,7 +376,7 @@ class into MongoDB:
370376 :language: kotlin
371377
372378In MongoDB, the ``LocalDate`` value is stored as a BSON date, and the
373- ``time`` field is stored by using default serialization as a string:
379+ ``time`` field is stored as a string by default serialization :
374380
375381.. code-block:: json
376382
0 commit comments