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

BSON::Document#fetch does not conform to Hash#fetch API

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • bson-4.4.2
    • Affects Version/s: bson-4.4.1
    • Component/s: BSON
    • Environment:
      Any
    • 1
    • Fully Compatible

      Hello!

      After update to ~> 4.4.0 (couldn't set the affect version unfortunately), using fetch on BSON::Document objects might fail - new fetch definition which overshadows Hash one has different set of arguments:

      bson-ruby

      https://github.com/mongodb/bson-ruby/blob/v4.4.1/lib/bson/document.rb#L50-L53

      fetch(key)

      ruby core

      https://ruby-doc.org/core-2.5.1/Hash.html#method-i-fetch
       
      fetch(key [, default] ) → obj
      fetch(key) {| key | block } → obj
       
      Best,
      Michał
       

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            fanfilmu Micha?
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: