count_documents is not documented/tested to take session option

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Michael Baldry
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: