Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5081

Support schema classes

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Builders
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      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?

      Show
      1. What would you like to communicate to the user about this feature? 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?

      In JAVA-3879, we added expressions related to documents. Expressions that refer to fields, like `doc.getInteger("fieldName")`, are some of the most frequently-needed, but are also relatively verbose.

      In our documentation, our examples generally extract these into variables, `var fieldName = ...`. This can be further moved into fields on a custom class, which allows for syntax like `doc.fieldName` or `doc.getFieldName()`. This approach runs into problems when the API itself needs to create such objects (for example, in `map(o -> ...)`, o would be a new instance of a particular object), but a POC created during the recent hackathon resolves these issues.

      This would be a non-invasive addition to the API that would make it more accessible for users.

            Assignee:
            Unassigned Unassigned
            Reporter:
            maxim.katcharov@mongodb.com Maxim Katcharov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: