-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Labels:
-
-
1
The docs for $bitsAllSet, $bitsAllClear, $bitsAnySet and $bitsAnyClear all state that numeric bit mask arguments must be representable as a non-negative 32-bit signed integer, but in the code we accept 64-bit unsigned ints as numeric bit masks. The docs should be updated to match this behavior.
For example, in the mongo shell, we can run the commands below using 1099511627777 as a bit mask, (where 1099511627777 ~= (2^40) + 1, and cannot fit in a 32 bit int).
> db.bit.find() { "_id" : ObjectId("660cd478ce50ad728988b2e0"), "a" : NumberLong(1) } > db.bit.find({a: {$bitsAnySet: NumberLong(1099511627777)}}) { "_id" : ObjectId("660cd478ce50ad728988b2e0"), "a" : NumberLong(1) }