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

atomic update with $set does not update fields with a null value and there is no obvious error

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 1.10.0
    • Component/s: Public API

      $DB['some_coll'].update(

      { '_id' => 'the_id' }

      ,
      {'$set' => { 'some_field' => 'some_value' }}
      )
      will update correctly most of the time and yield something like:

      {"updatedExisting"=>true, "n"=>1, "lastOp"=>#<BSON::Timestamp:0x00000002d4b438 @seconds=1407952851, @increment=4>, "connectionId"=>5690808, "err"=>nil, "ok"=>1.0}

      but if the value to be updated is null, it returns similarly, but fails to update the value. Deleting the field (from MongoHub) and running the exact same thing will be successful. Loading the doc (.find_one()), and then saving it (.save()) with the updates made in ruby, is also successful.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            asheridan Andrew Sheridan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: