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

count_documents is not documented/tested to take session option

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.18.0
    • Affects Version/s: 2.16.0
    • Component/s: None
    • Fully Compatible

      When running inside a session and a transaction, `count_documents` doesn't include any changes that are in the current transaction as the session is not passed through from `Mongo::Collection::View`'s options to the `Aggregration` options.

       

      https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/collection/view/readable.rb#L214

       

      should add `options[:session]` to `opts[:session]` - there are probably more options it would make sense to pass through. See also RUBY-1665

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            michael@brightbits.co.uk Michael Baldry
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: