Database Manual / Reference / Query Language / Update

Bitwise Update Operator按位更新运算符

Note

For details on a specific command, including syntax and examples, click on the link to the command's reference page.有关特定命令的详细信息,包括语法和示例,请单击指向该命令参考页面的链接。

Name名称Description描述
$bit

Performs bitwise AND, OR, and XOR (exclusive OR) updates of integer values. The $bit operator performs a bitwise update of a field.执行整数值的逐位ANDORXOR(异或)更新。$bit运算符执行字段的逐位更新。

The $bit operator can only be used with integer and long values. The integers must be 32-bit integer or 64-bit integer values.$bit运算符只能用于整数和长值。整数必须是32位整数值或64位整数值。

All numbers in mongosh are double precision floating point numbers, not integers. 蒙古语中的所有数字都是双精度浮点数,而不是整数。To define integers in mongosh, use the Int32() or Long() constructors. For example, Int32(5), Long(23455).要在mongosh中定义整数,请使用Int32()Long()构造函数。例如,Int32(5)Long(23455)

To learn more about integers and long numbers, see Int32 and Long.要了解有关整数和长数的更多信息,请参阅Int32long