$bit operator seems not to modify an integer in place

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      $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" : "" }
      

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: