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

Add generic builders for query filters, sorts, and projections

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: None
    • Component/s: API, Query Operations
    • None

      The proposed syntax makes heavy use of static methods (which can be imported to improve readability). It will allow code like this:

      collection.find(and(eq("x", "val"), gt("y", 5), lt("y", 10))
                .sort(orderBy(ascending("y", "z"), descending("a")))
                .projection(fields(include("y", "z", "a"), excludeId()));
      

      assuming aggressive use of static imports.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: