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

NoMethodError in 2.6 servers when bulk upserts use non-ObjectID _id field

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.10.2
    • Affects Version/s: None
    • Component/s: None
    • None

      The following bulk operation results in a NoMethodError:

      > bulk.find({:_id => 3}).upsert.update({"$set" => {:b => 3}}) 
      > result = bulk.execute
      NoMethodError: undefined method `collect' for 3:Fixnum
      

      The very likely culprit is this line of code , which assumes that if the "upserted" field in the result from a bulk operation is not an ObjectId, then it must be an array.

            Assignee:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: