Skip to content

Commit 9d93f51

Browse files
committed
RR feedback
1 parent 131f234 commit 9d93f51

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

source/fundamentals/data-formats/serialization.txt

+7-8
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,14 @@ The following example shows how to create a codec using the
244244

245245
.. _kotlin-serialization-snake-case-eg:
246246

247-
Enforcing Snake Case Naming Example
248-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247+
Implement Snake Case Naming Strategy
248+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249249

250-
The following example shows how to convert field names from their data class
251-
fields into snake case by setting the ``bsonNamingStrategy`` parameter:
250+
When using ``bson-kotlinx`` package v5.4 or later, you can direct the driver to
251+
serialize data class fields names written in camel case to snake case in MongoDB.
252+
The following example shows how to create and register a custom codec
253+
to convert data class field names into snake case by setting the
254+
``bsonNamingStrategy`` parameter in a codec:
252255

253256
.. code-block:: kotlin
254257
:copyable: true
@@ -259,10 +262,6 @@ fields into snake case by setting the ``bsonNamingStrategy`` parameter:
259262
.. literalinclude:: /examples/generated/KotlinXSerializationTest.snippet.snake-case-naming.kt
260263
:language: kotlin
261264

262-
.. note::
263-
264-
The ``bsonNamingStrategy`` parameter is available for bson-kotlinx v5.4 and later.
265-
266265
For more information about the methods and classes mentioned in this section,
267266
see the following API documentation:
268267

source/whats-new.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ What's New in 5.4
3131
The 5.4 driver release includes the following changes, fixes,
3232
and features:
3333

34-
- Adds support for converting field names to snake case during serialization. To
35-
learn more, see the :ref:`kotlin-serialization-snake-case-eg` on the
36-
Serialization page.
34+
- Adds ``BsonConfiguration`` support for bson-kotlinx snake case conversion
35+
during serialization. To learn more, see the
36+
:ref:`kotlin-serialization-snake-case-eg` on the Serialization page.
3737

3838
.. sharedinclude:: dbx/jvm/v5.4-wn-items.rst
3939

0 commit comments

Comments
 (0)