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

aggregation.allow_disk_use(true) is not affecting aggregation in_place

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 2.1.0
    • Component/s: Docs, Public API
    • None

      In documentation http://docs.mongodb.org/ecosystem/tutorial/ruby-driver-tutorial/#aggregation it states that the correct way to add the "allowDiskUse" option to the aggregation is:

      aggregation.allow_disk_use(true)
      aggregation.each do |document|
      #=> Yields a BSON::Document.
      end

      and then continues on iterating the results from "aggregation".
      However when tested against 2.1.0 the above command does not modify aggregation in place, but instead returns a new aggregation object with that option specified. To make it work we need to do:

      aggregation = aggregation.allow_disk_use(true)
      aggregation.each do |document|
      #=> Yields a BSON::Document.
      end

      or

      aggregation.allow_disk_use(true).each do |document|
      #=> Yields a BSON::Document.
      end

      Not sure which one of the two solutions was intended but it would be nice to have either the documentation or the driver fix to comply with the other.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            clarkgr George L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: