Consider API that facilitates building native queries

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The driver already provides API for building parts of MQL. But in the context of native queries, more API may be useful. It is unclear what that API may be, but here are some examples of what may be useful:

      1. NativeQueryIntegrationTests.mql builds the $aggregate command, as the driver does not expose a method for the same.
      2. We require applications to specify the $project stage in a native query. When an application has to use SqlResultSetMapping, it has to repeat the set of selected columns in it. To avoid such duplication, we could expose a static method like Bson project(Class<?> entityClass, String resultSetMappingName), which finds the SqlResultSetMapping annotation with the specified SqlResultSetMapping.name on the specified entity class, and constructs the $project stage from it. This idea was expressed by slav.babanin@mongodb.com.

            Assignee:
            Unassigned
            Reporter:
            Valentin Kavalenka
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: