Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-876

Can't use options for Aggregate Queries

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 1.11.1
    • Component/s: Public API
    • Labels:
      None

      There are several big errors in the implementation of the aggregate function. If I try to add any options to the aggregate query such as cursor or allowDiskUse I get an error stating it is an unrecognized field. It almost seems like it is viewing the options as part of the pipeline array.

      example:
      col.aggregate([ some pipeline code here ], :cursor => {} ) will throw error 'unrecognized field cursor'. This is exactly like the comments for the aggregate function say to write this and it still doesn't work. I've tried it wrapped in brackets {} and also as a string rather than a symbol and I always get the same error.

      I'm not sure if the option of allowDiskUse is even supported by the driver as it is not mentioned in the comment like cursor is but if it is not it is a big oversight.

      Another issue is that the $literal operator does not work at all and returns Database command 'aggregate' failed: exception: invalid operator '$literal'

      These issues make the aggregate function near unusable for all but the most basic queries.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            rosspace ross pace
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: