Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4937

$bit operator seems not to modify an integer in place

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Write Ops
    • None
    • Query

    Description

      $inc can update a document in place (using 'fastmod') but $bit does not seem to do this

       
      c.update( {}, {$bit:{a:{and:NumberLong(2)}}} )
       
      { "ts" : ISODate("2012-02-12T02:00:28.892Z"), "op" : "update", "ns" : "test.c", "query" : { }, "updateobj" : { "$bit" : { "a" : { "and" : NumberLong(2) } } }, "nscanned" : 1, "nupdated" : 1, "keyUpdates" : 0, "millis" : 0, "client" : "127.0.0.1", "user" : "" }
       
      c.update( {}, {$inc:{a:NumberLong(2)}} )
       
      { "ts" : ISODate("2012-02-12T02:01:36.263Z"), "op" : "update", "ns" : "test.c", "query" : { }, "updateobj" : { "$inc" : { "a" : NumberLong(2) } }, "nscanned" : 1, "nupdated" : 1, "fastmod" : true, "keyUpdates" : 0, "millis" : 0, "client" : "127.0.0.1", "user" : "" }

      Attachments

        Activity

          People

            backlog-server-query Backlog - Query Team (Inactive)
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: