Signature change for aggregate helper method

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.9.0, 2.9.1
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Any chance you could consider changing the signature of the aggregate
      helper method to a single vararg argument, or adding an overloaded
      signature that takes List<DBObject>? I assume the reason that the
      first op was modelled as a separate argument was to make it clear to
      users that at least one operation was required. I actually think
      that's adequately clear as just a vararg argument, and having the
      first argument separate makes it more complex when you already have
      the pipeline as a list or array.

      That is, from:

      public AggregationOutput aggregate( DBObject firstOp, DBObject ... additionalOps)

      to:

      public AggregationOutput aggregate( DBObject ... ops)

      or add:

      public AggregationOutput aggregate( List<DBObject> ops)

      The particular case I'm looking at is the run method in the class
      below. I'm currently using a workaround that splits the first op and
      the remainder before passing them to the helper method.

      https://bitbucket.org/davidmc24/mongo-java-aggregate/src/6e0e93bfe2a4/src/main/java/org/bitbucket/davidm24/mongodb/aggregate/AggregateBuilder.java

            Assignee:
            Unassigned
            Reporter:
            David M. Carr
            None
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: