Skip to content

DOCS-11140: bitwise query operations can't use indexes #3183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions source/includes/extracts-fact-query-bitwise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ref: _fact-query-bitwise-floating-point
content: |
:query:`{{op}}` will not match numerical values that cannot be represented as
a signed 64-bit integer. This can be the case if a value is either too large
or small to fit in a signed 64-bit integer, or if it has a fractional
or too small to fit in a signed 64-bit integer, or if it has a fractional
component.
---
ref: fact-query-bitsallset-floating-point
Expand Down Expand Up @@ -129,7 +129,7 @@ inherit:
---
ref: _fact-query-bitwise-sign-extension
content: |
Numbers are sign extended. For example, {{op}} considers bit position ``200``
Numbers are sign extended. For example, :query:`{{op}}` considers bit position ``200``
to be set for the negative number ``-5``, but bit position ``200`` to be clear
for the positive number ``+5``.

Expand All @@ -140,7 +140,7 @@ content: |

db.collection.save({ x: BinData(0, "ww=="), binaryValueofA: "11000011" })

{{op}} will consider all bits outside of ``x`` to be clear.
:query:`{{op}}` will consider all bits outside of ``x`` to be clear.
---
ref: fact-query-bitsallset-sign-extension
replacement:
Expand Down Expand Up @@ -180,4 +180,38 @@ content: |
db.collection.save({ _id: 2, a: 20, binaryValueofA: "00010100" })
db.collection.save({ _id: 3, a: 20.0, binaryValueofA: "00010100" })
db.collection.save({ _id: 4, a: BinData(0, "Zg=="), binaryValueofA: "01100110" })
---
ref: _fact-query-bitwise-indexes
content: |
Queries cannot use indexes for the :query:`{{op}}` portion of a
query, although the other portions of a query can use indexes, if
applicable.
---
ref: fact-query-bitwise-indexes-bitsAnySet
replacement:
op: "$bitsAnySet"
inherit:
ref: _fact-query-bitwise-indexes
file: extracts-fact-query-bitwise.yaml
---
ref: fact-query-bitwise-indexes-bitsAnyClear
replacement:
op: "$bitsAnyClear"
inherit:
ref: _fact-query-bitwise-indexes
file: extracts-fact-query-bitwise.yaml
---
ref: fact-query-bitwise-indexes-bitsAllSet
replacement:
op: "$bitsAllSet"
inherit:
ref: _fact-query-bitwise-indexes
file: extracts-fact-query-bitwise.yaml
---
ref: fact-query-bitwise-indexes-bitsAllClear
replacement:
op: "$bitsAllClear"
inherit:
ref: _fact-query-bitwise-indexes
file: extracts-fact-query-bitwise.yaml
...
7 changes: 6 additions & 1 deletion source/reference/operator/query/bitsAllClear.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ $bitsAllClear
Behavior
--------

Indexes
~~~~~~~

.. include:: /includes/extracts/fact-query-bitwise-indexes-bitsAllClear.rst

Floating Point Values
~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -30,7 +35,7 @@ Floating Point Values
Sign Extension
~~~~~~~~~~~~~~

.. include:: /includes/extracts/fact-query-bitsallset-sign-extension.rst
.. include:: /includes/extracts/fact-query-bitsallclear-sign-extension.rst

Examples
--------
Expand Down
5 changes: 5 additions & 0 deletions source/reference/operator/query/bitsAllSet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ $bitsAllSet
Behavior
--------

Indexes
~~~~~~~

.. include:: /includes/extracts/fact-query-bitwise-indexes-bitsAllSet.rst

Floating Point Values
~~~~~~~~~~~~~~~~~~~~~

Expand Down
7 changes: 6 additions & 1 deletion source/reference/operator/query/bitsAnyClear.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ $bitsAnyClear
Behavior
--------

Indexes
~~~~~~~

.. include:: /includes/extracts/fact-query-bitwise-indexes-bitsAnyClear.rst

Floating Point Values
~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -30,7 +35,7 @@ Floating Point Values
Sign Extension
~~~~~~~~~~~~~~

.. include:: /includes/extracts/fact-query-bitsallset-sign-extension.rst
.. include:: /includes/extracts/fact-query-bitsanyclear-sign-extension.rst

Examples
--------
Expand Down
7 changes: 6 additions & 1 deletion source/reference/operator/query/bitsAnySet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ $bitsAnySet
Behavior
--------

Indexes
~~~~~~~

.. include:: /includes/extracts/fact-query-bitwise-indexes-bitsAnySet.rst

Floating Point Values
~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -30,7 +35,7 @@ Floating Point Values
Sign Extension
~~~~~~~~~~~~~~

.. include:: /includes/extracts/fact-query-bitsallset-sign-extension.rst
.. include:: /includes/extracts/fact-query-bitsanyset-sign-extension.rst

Examples
--------
Expand Down