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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Cannot Reproduce
    • 1.10.0
    • 12_01_17
    • Public API

    Description

      $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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: