DOCSP-36218: builders with dataclass properties#186
DOCSP-36218: builders with dataclass properties#186rustagir merged 21 commits intomongodb:masterfrom
Conversation
✅ Deploy Preview for docs-kotlin ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Question for technical reviewer:
Should I change the examples on this page instead of adding this note?
There was a problem hiding this comment.
The kotlin-extensions module is optional (similar to bson-kotlinx) I think we should keep existing examples and add a section that mentions this module with a couple of examples using data class properties instead of strings.
There are many extensions (see Epic for a general breakdown) I suggest using the tests to pick one or two examples for each category (ex: one example for filter, one for projections, one for updates etc.)
This will be a one stop page/section for people familiar with KMongo or who want to use the driver in a more typesafe manner.
There was a problem hiding this comment.
Question for technical reviewer:
Is this the correct way to describe this?
There was a problem hiding this comment.
As mentioned in the previous comment, I suggest grouping all these extensions (not just Filters) into a single section. This will improve the discoverability of extensions beyond the common Filter/equality use case.
(see how KMongo goups them here https://litote.org/kmongo/extensions-overview/)
Additionally, we should emphasize that this module is optional (i.e we need to pull implementation("org.mongodb:mongodb-driver-kotlin-extensions:X.Y.Z") dependencyto use it) and clarify the use of different package names. For example, the current string-based gt operator is located in com.mongodb.client.model.Filters, whereas the extensions utilizing data class properties are found in com.mongodb.kotlin.client.model.Filters. This design allows developers to mix both data class property-based and string-based calls within the same application.
There was a problem hiding this comment.
Is this referenced somewhere?
There was a problem hiding this comment.
The kotlin-extensions module is optional (similar to bson-kotlinx) I think we should keep existing examples and add a section that mentions this module with a couple of examples using data class properties instead of strings.
There are many extensions (see Epic for a general breakdown) I suggest using the tests to pick one or two examples for each category (ex: one example for filter, one for projections, one for updates etc.)
This will be a one stop page/section for people familiar with KMongo or who want to use the driver in a more typesafe manner.
There was a problem hiding this comment.
As mentioned in the previous comment, I suggest grouping all these extensions (not just Filters) into a single section. This will improve the discoverability of extensions beyond the common Filter/equality use case.
(see how KMongo goups them here https://litote.org/kmongo/extensions-overview/)
Additionally, we should emphasize that this module is optional (i.e we need to pull implementation("org.mongodb:mongodb-driver-kotlin-extensions:X.Y.Z") dependencyto use it) and clarify the use of different package names. For example, the current string-based gt operator is located in com.mongodb.client.model.Filters, whereas the extensions utilizing data class properties are found in com.mongodb.kotlin.client.model.Filters. This design allows developers to mix both data class property-based and string-based calls within the same application.
nhachicha
left a comment
There was a problem hiding this comment.
Thanks for iterating on this LGTM 👍
Suggestion: https://deploy-preview-186--docs-kotlin.netlify.app/migrate-kmongo/ still contains the existing snippet using String based operation, maybe we could add a third tab showing how the syntax would look if we pull the optional extension library?
There was a problem hiding this comment.
Is this referenced somewhere?
* DOCSP-36218: filters with dataclass properties * fixes * fixes * PR restructure and pushing v5.3 changes * cross links * fixes * fixes * shorten toc name * fix link * small version fixes * add cross link * RM PR fixes 1 * add note to Kmongo page * vale fixes * NH tech review 2 * wip * wip * wip (cherry picked from commit 8471f29)
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-36218
Staging:
Self-Review Checklist