Call aggregate directly on collection instead of on find view

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 8.0.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      Mongoid has one place in master where it calls `collection.find.aggregate`.:

      lib/mongoid/contextual/aggregable/mongo.rb:          result = collection.find.aggregate(pipeline(field), session: _session).to_a
      

      This usage can cause issues if https://jira.mongodb.org/browse/RUBY-2797 is implemented to pass find view parameters to the aggregation pipeline.

      Mongoid should simply invoke aggregate directly on the collection, as is documented in https://www.mongodb.com/docs/ruby-driver/master/reference/aggregation/.

              Assignee:
              Oleg Pudeyev (Inactive)
              Reporter:
              Oleg Pudeyev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: