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:
8282BinData Bitmask
8383~~~~~~~~~~~~~~~
8484
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:
8886
8987.. code-block:: javascript
9088
9189 db.collection.find( { a: { $bitsAllClear: BinData(0, "ID==") } } )
9290
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:
94102
95103.. code-block:: javascript
96104
You can’t perform that action at this time.
0 commit comments