[SERVER-4937] $bit operator seems not to modify an integer in place Created: 12/Feb/12  Updated: 06/Dec/22  Resolved: 09/May/18

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Aaron Staple Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query
Participants:

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



 Comments   
Comment by Asya Kamsky [ 09/May/18 ]

Was only relevant to MMAPV1 so closing as won't fix.

 

Generated at Thu Feb 08 03:07:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.