[JAVA-4872] Create bson-kotlin Created: 08/Feb/23  Updated: 28/Oct/23  Resolved: 22/Mar/23

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 4.10.0

Type: Improvement Priority: Unknown
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Epic Link: Improve Kotlin User Experience
Quarter: FY24Q1
Documentation Changes: Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?

The bson-kotlin dependency is optional but if present is available via the default codec registry.

Uses reflection and the codec registry to support Kotlin Dataclasses
Some Pojo annotations are not supported (BsonDiscriminator, BsonExtraElements, BsonConstructor).

Users should generally prefer the faster bson-kotlinx library

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?

For the new kotlin wrapper of the Java driver


 Description   

Support Kotlin types / Data Classes both via Codecs

New code - follow the Java record codec approach rather than port the modified pojo codec.



 Comments   
Comment by Githook User [ 22/Mar/23 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Updated bson-kotlin in prep for bson-kotlinx

Expanded the test cases
Simplified the DataClassCodecProvider

JAVA-4872 JAVA-4873
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/814fd15e595490e05f9915dcfe146c3a7acdd94c

Generated at Thu Feb 08 09:03:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.