-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSP-36217: polymorphic serialization #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a couple of callouts!
In this example, you create an interface and two data classes that | ||
inherit that interface. In the data classes, the ``id`` field is marked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
In this example, you create an interface and two data classes that | |
inherit that interface. In the data classes, the ``id`` field is marked | |
The following example creates an interface and two data classes that | |
inherit that interface. In the data classes, the ``id`` field is marked |
Then, you can perform operations with data classes as usual. In the | ||
following example, you parametrize the collection with the ``Person`` | ||
interface, but you can perform operations with the polymorphic classes | ||
``Teacher`` and ``Student``. When you retrieve documents, the driver | ||
automatically detects the type based on the discriminator value and | ||
deserializes them accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (these are based on the way we seem to typically introduce examples, let me know if I'm on the wrong track here).
Then, you can perform operations with data classes as usual. In the | |
following example, you parametrize the collection with the ``Person`` | |
interface, but you can perform operations with the polymorphic classes | |
``Teacher`` and ``Student``. When you retrieve documents, the driver | |
automatically detects the type based on the discriminator value and | |
deserializes them accordingly. | |
Then, you can perform operations with data classes as usual. The following | |
example parametrizes the collection with the ``Person`` | |
interface and performs operations with the polymorphic classes | |
``Teacher`` and ``Student``. When you retrieve documents, the driver | |
automatically detects the type based on the discriminator value and | |
deserializes them accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* DOCSP-36217: polymorphic serialization * wip * wip * wip * fix error in codectest * MM PR fixes 1 (cherry picked from commit b5a5af9)
✨ Staging URL: https://preview-mongodbmongodb.gatsbyjs.io/kotlin/master/ 🪵 Logs |
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-36217
Staging - https://preview-mongodbrustagir.gatsbyjs.io/kotlin/DOCSP-36217-polymorphic/fundamentals/data-formats/serialization/#polymorphic-serialization
Self-Review Checklist