File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
source/reference/operator/query Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,23 @@ The query matches the following documents:
82
82
BinData Bitmask
83
83
~~~~~~~~~~~~~~~
84
84
85
- The following query uses the :query:`$bitsAllClear` operator to test
86
- whether field ``a`` has bits clear at positions ``2`` and ``4``
87
- (the binary representation of ``BinData(0, "ID==")`` is ``00010100``.
85
+ The following query uses the :query:`$bitsAllClear` operator:
88
86
89
87
.. code-block:: javascript
90
88
91
89
db.collection.find( { a: { $bitsAllClear: BinData(0, "ID==") } } )
92
90
93
- The query matches the following documents:
91
+ The query:
92
+
93
+ - Specifies ``0`` as the first value for :bsontype:`BinData
94
+ <data_binary>`, which indicates ``ID==`` is to be interpreted as
95
+ binary. The base-64 value ``ID==`` in binary is ``00100000``, which
96
+ has ``1`` in position 5.
97
+
98
+ - Uses :query:`$bitsAllClear` to return documents where the ``a`` field
99
+ has a clear bit ``0`` in position 5 of the binary value.
100
+
101
+ The query returns the following documents:
94
102
95
103
.. code-block:: javascript
96
104
You can’t perform that action at this time.
0 commit comments