- Reference >
- Operators >
- Update Operators >
- Bitwise Update Operator >
- $bit
$bit¶
-
$bit
¶ The
$bit
operator performs a bitwise update of a field. Only use this with integer fields, as in the following examples:Here, the
$bit
operator updates the integer value of the field namedfield
: in the first example with a bitwiseand: 5
operation; and in the second example with a bitwiseor: 5
operation.$bit
only works with integers.$bit
only supportsAND
andOR
bitwise operations.