From 4037c6a8d7d04db5b902bb3671471c9f3b813f7e Mon Sep 17 00:00:00 2001 From: Andrew Aldridge Date: Wed, 2 Dec 2015 13:42:05 -0500 Subject: [PATCH] Fix reported issues with bitwise reference pages --- source/reference/operator/query/bitsAllClear.txt | 8 ++++---- source/reference/operator/query/bitsAllSet.txt | 9 ++++----- source/reference/operator/query/bitsAnyClear.txt | 12 ++++++------ source/reference/operator/query/bitsAnySet.txt | 12 +++++------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/source/reference/operator/query/bitsAllClear.txt b/source/reference/operator/query/bitsAllClear.txt index 12907bc77e5..7299a0ef5fa 100644 --- a/source/reference/operator/query/bitsAllClear.txt +++ b/source/reference/operator/query/bitsAllClear.txt @@ -54,8 +54,8 @@ Integer Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAllClear` operator to test -whether field ``a`` has bits clear at positions ``0``, ``1``, and ``5``, -because the binary representation of the bitmask ``35`` is ``00100011``. +whether field ``a`` has bits clear at positions ``0``, ``1``, and ``5`` +(the binary representation of the bitmask ``35`` is ``00100011``). .. code-block:: javascript @@ -72,8 +72,8 @@ BinData Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAllClear` operator to test -whether field ``a`` has bits clear at positions `1`, `4`, and `5`, because the -binary representation of ``BinData(0, "MC==")`` is ``00110010``. +whether field ``a`` has bits clear at positions `2` and `4` +(the binary representation of ``BinData(0, "ID==")`` is ``00010100``. .. code-block:: javascript diff --git a/source/reference/operator/query/bitsAllSet.txt b/source/reference/operator/query/bitsAllSet.txt index a1cc1dbf46a..3ccd3468385 100644 --- a/source/reference/operator/query/bitsAllSet.txt +++ b/source/reference/operator/query/bitsAllSet.txt @@ -54,9 +54,8 @@ Integer Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAllSet` operator to test -whether field ``a`` has bits set at positions ``0``, ``1``, and ``5``, -because the binary representation of the bitmask ``35`` is ``00100011``. - +whether field ``a`` has bits set at positions ``1``, ``4``, and ``5`` +(the binary representation of the bitmask ``50`` is ``00110010``). .. code-block:: javascript @@ -72,8 +71,8 @@ BinData Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAllSet` operator to test -whether field ``a`` has bits set at positions `1`, `4`, and `5`, because the -binary representation of ``BinData(0, "MC==")`` is ``00110010``. +whether field ``a`` has bits set at positions `4` and `5` +(the binary representation of ``BinData(0, "MC==")`` is ``00110000``). .. code-block:: javascript diff --git a/source/reference/operator/query/bitsAnyClear.txt b/source/reference/operator/query/bitsAnyClear.txt index d0125f816b4..cfcd46388ea 100644 --- a/source/reference/operator/query/bitsAnyClear.txt +++ b/source/reference/operator/query/bitsAnyClear.txt @@ -53,17 +53,18 @@ Integer Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAnyClear` operator to test -whether field ``a`` has any bits clear at positions ``0``, ``1``, and ``5``, -because the binary representation of the bitmask ``35`` is ``00100011``. +whether field ``a`` has any bits clear at positions ``0``, ``1``, and ``5`` +(the binary representation of the bitmask ``35`` is ``00100011``). .. code-block:: javascript - db.collection.find( { a: { $bitsAnyClear: 50 } } ) + db.collection.find( { a: { $bitsAnyClear: 35 } } ) The query matches the following documents: .. code-block:: javascript + { "_id" : 1, "a" : 54, "binaryValueofA" : "00110110" } { "_id" : 2, "a" : 20, "binaryValueofA" : "00010100" } { "_id" : 3, "a" : 20.0, "binaryValueofA" : "00010100" } { "_id" : 4, "a" : BinData(0,"Zg=="), "binaryValueofA" : "01100110" } @@ -71,10 +72,9 @@ The query matches the following documents: BinData Bitmask ~~~~~~~~~~~~~~~ - The following query uses the :query:`$bitsAnyClear` operator to test -whether field ``a`` has any bits clear at positions `1`, `4`, and `5`, because -the binary representation of ``BinData(0, "MC==")`` is ``00110010``. +whether field ``a`` has any bits clear at positions `4` and `5` +(the binary representation of ``BinData(0, "MC==")`` is ``00110000``). .. code-block:: javascript diff --git a/source/reference/operator/query/bitsAnySet.txt b/source/reference/operator/query/bitsAnySet.txt index 6d06989bfba..61cb19b6042 100644 --- a/source/reference/operator/query/bitsAnySet.txt +++ b/source/reference/operator/query/bitsAnySet.txt @@ -54,28 +54,26 @@ Integer Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAnySet` operator to test -whether field ``a`` has any bits set at positions ``0``, ``1``, and ``5``, -because the binary representation of the bitmask ``35`` is ``00100011``. +whether field ``a`` has any bits set at positions ``0``, ``1``, and ``5`` +(the binary representation of the bitmask ``35`` is ``00100011``). .. code-block:: javascript - db.collection.find( { a: { $bitsAnySet: 50 } } ) + db.collection.find( { a: { $bitsAnySet: 35 } } ) The query matches the following documents: .. code-block:: javascript { "_id" : 1, "a" : 54, "binaryValueofA" : "00110110" } - { "_id" : 2, "a" : 20, "binaryValueofA" : "00010100" } - { "_id" : 3, "a" : 20.0, "binaryValueofA" : "00010100" } { "_id" : 4, "a" : BinData(0,"Zg=="), "binaryValueofA" : "01100110" } BinData Bitmask ~~~~~~~~~~~~~~~ The following query uses the :query:`$bitsAnySet` operator to test -whether field ``a`` has any bits set at positions `1`, `4`, and `5`, because the -binary representation of ``BinData(0, "MC==")`` is ``00110010``. +whether field ``a`` has any bits set at positions `4`, and `5` +(the binary representation of ``BinData(0, "MC==")`` is ``00110000``). .. code-block:: javascript