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

aggregation.allow_disk_use(true) is not affecting aggregation in_place

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 12_01_17
    • Component/s: Documentation, Public API
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: