Skip to content

Commit 340c7cb

Browse files
authored
DOCSP-25223 Version Cleanup of Operators Reference (#1890) (#1928)
* DOCSP-25223 Removes EOL versions from $regex and $text * DOCSP-25223 $text and $type cleanup * DOCSP-25223 $not and $position cleanup" * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Dave * DOCSP-25223 Fixes per Kyle Suarz * DOCSP-25223 Fixes per Kyle Suarz
1 parent 0058a58 commit 340c7cb

File tree

6 files changed

+25
-59
lines changed

6 files changed

+25
-59
lines changed

source/includes/fact-bson-types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
* - Decimal128
100100
- 19
101101
- "decimal"
102-
- New in version 3.4.
102+
-
103103

104104
* - Min key
105105
- -1

source/reference/operator/query/not.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ data types like arrays.
5858

5959
:query:`$not` operator can perform logical ``NOT`` operation on:
6060

61-
- regular expression objects (i.e. ``/pattern/``)
61+
- Regular expression objects (i.e. ``/pattern/``)
6262

6363
For example, the following query selects all documents in the
6464
``inventory`` collection where the ``item`` field value does *not*
@@ -68,7 +68,7 @@ data types like arrays.
6868

6969
db.inventory.find( { item: { $not: /^p.*/ } } )
7070

71-
- :query:`$regex` operator expression (Starting in MongoDB 4.0.7)
71+
- :query:`$regex` operator expression
7272

7373
For example, the following query selects all documents in the
7474
``inventory`` collection where the ``item`` field value does *not*

source/reference/operator/query/regex.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,18 @@ field strings that match the regular expression ``"(?i)a(?-i)cme"``:
186186
``$regex`` and ``$not``
187187
```````````````````````
188188

189-
Starting in 4.0.7, :query:`$not` operator can perform logical ``NOT``
189+
The :query:`$not` operator can perform logical ``NOT``
190190
operation on both:
191191

192-
- regular expression objects (i.e. ``/pattern/``)
192+
- Regular expression objects (i.e. ``/pattern/``)
193193

194194
For example:
195195

196196
.. code-block:: javascript
197197

198198
db.inventory.find( { item: { $not: /^p.*/ } } )
199199

200-
- :query:`$regex` operator expressions (starting in MongoDB 4.0.7).
200+
- :query:`$regex` operator expressions
201201

202202
For example:
203203

source/reference/operator/query/text.txt

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ Definition
9595
- boolean
9696

9797
- Optional. A boolean flag to enable or disable diacritic sensitive search
98-
against :doc:`version 3 text indexes </core/index-text>`. Defaults to
98+
against version 3 :ref:`text <index-feature-text>` indexes. Defaults to
9999
``false``; i.e. the search defers to the diacritic insensitivity of
100-
the :doc:`text </core/index-text>` index.
101-
102-
Text searches against earlier versions of the text index are
100+
the ``text`` index.
101+
102+
Text searches against earlier versions of the ``text`` index are
103103
inherently diacritic sensitive and cannot be diacritic insensitive.
104104
As such, the ``$diacriticSensitive`` option has no effect with
105-
earlier versions of the text index.
105+
earlier versions of the ``text`` index.
106106

107107
For more information, see :ref:`text-operator-diacritic-sensitivity`.
108108

@@ -264,12 +264,10 @@ matches on the exact word.
264264
Case Insensitivity
265265
~~~~~~~~~~~~~~~~~~
266266

267-
.. versionchanged:: 3.2
268-
269267
The :query:`$text` operator defaults to the case insensitivity of the
270268
:doc:`text </core/index-text>` index:
271269

272-
- The :ref:`version 3 text index <text-index-case-insensitivity>` is
270+
- The version 3 :ref:`text index <text-index-case-insensitivity>` is
273271
case insensitive for Latin characters with or without diacritics and
274272
characters from non-Latin alphabets, such as the Cyrillic alphabet.
275273
See :ref:`text <text-index-case-insensitivity>` index for details.
@@ -313,12 +311,10 @@ Specifying ``$caseSensitive: true`` may impact performance.
313311
Diacritic Insensitivity
314312
~~~~~~~~~~~~~~~~~~~~~~~
315313

316-
.. versionchanged:: 3.2
317-
318314
The :query:`$text` operator defaults to the diacritic insensitivity of
319315
the :doc:`text </core/index-text>` index:
320316

321-
- The :ref:`version 3 text index <text-index-diacritic-insensitivity>` is
317+
- The version 3 :ref:`text index <text-index-diacritic-insensitivity>` is
322318
diacritic insensitive. That is, the index does not distinguish
323319
between characters that contain diacritical marks and their
324320
non-marked counterpart, such as ``é``, ``ê``, and ``e``.
@@ -328,11 +324,11 @@ the :doc:`text </core/index-text>` index:
328324
``$diacriticSensitive`` Option
329325
``````````````````````````````
330326

331-
To support diacritic sensitive text search against the version 3
332-
``text`` index, specify ``$diacriticSensitive: true``.
327+
To support diacritic sensitive text search against the ``text`` index,
328+
specify ``$diacriticSensitive: true``.
333329

334330
Text searches against earlier versions of the ``text`` index are
335-
inherently diacritic sensitive and cannot be diacritic insensitive. As
331+
inherently diacritic sensitive and cannot be diacritic insensitive. As
336332
such, the ``$diacriticSensitive`` option for the :query:`$text`
337333
operator has no effect with earlier versions of the ``text`` index.
338334

@@ -353,7 +349,7 @@ Specifying ``$diacriticSensitive: true`` may impact performance.
353349

354350
To perform a diacritic sensitive search against an earlier version of
355351
the ``text`` index, the :query:`$text` operator searches the ``text``
356-
index which is diacritic sensitive.
352+
index, which is diacritic sensitive.
357353

358354
For diacritic sensitive search, if the suffix stem contains the
359355
diacritic mark or marks, the :query:`$text` operator matches on the
@@ -376,7 +372,7 @@ Examples
376372
--------
377373

378374
The following examples assume a collection ``articles`` that has a
379-
:doc:`version 3 text </core/index-text>` index on the field ``subject``:
375+
version 3 :doc:`text </core/index-text>` index on the field ``subject``:
380376

381377
.. code-block:: javascript
382378

@@ -537,8 +533,6 @@ languages.
537533
Case and Diacritic Insensitive Search
538534
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
539535

540-
.. versionchanged:: 3.2
541-
542536
The :query:`$text` operator defers to the case and diacritic
543537
insensitivity of the ``text`` index. The version 3 ``text`` index is
544538
diacritic insensitive and expands its case insensitivity to include the
@@ -563,7 +557,7 @@ documents.
563557
{ "_id" : 5, "subject" : "Café Con Leche", "author" : "abc", "views" : 200 }
564558
{ "_id" : 8, "subject" : "Cafe con Leche", "author" : "xyz", "views" : 10 }
565559

566-
With the previous versions of the ``text`` index, the query would not
560+
With previous versions of the ``text`` index, the query would not
567561
match any document.
568562

569563
.. seealso::
@@ -578,8 +572,6 @@ match any document.
578572
Perform Case Sensitive Search
579573
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
580574

581-
.. versionchanged:: 3.2
582-
583575
To enable case sensitive search, specify ``$caseSensitive: true``.
584576
Specifying ``$caseSensitive: true`` may impact performance.
585577

@@ -657,9 +649,7 @@ The query matches the following document:
657649
Diacritic Sensitive Search
658650
~~~~~~~~~~~~~~~~~~~~~~~~~~
659651

660-
.. versionchanged:: 3.2
661-
662-
To enable diacritic sensitive search against a version 3 :doc:`text
652+
To enable diacritic sensitive search against a version 3 :doc:`text
663653
</core/index-text>` index, specify ``$diacriticSensitive: true``.
664654
Specifying ``$diacriticSensitive: true`` may impact performance.
665655

@@ -757,7 +747,7 @@ Sort by Text Search Score
757747
.. include:: /includes/extracts/4.4-changes-projection-sort-meta-list.rst
758748

759749

760-
- In MongoDB 4.2 and earlier, to sort by the text score, include the
750+
- In MongoDB 4.2, to sort by the text score, include the
761751
**same** :expression:`$meta` expression in **both** the projection
762752
document and the sort expression. The following
763753
query searches for the term ``coffee`` and sorts the results by the

source/reference/operator/query/type.txt

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ Definition
2323
A :query:`$type` expression for a single :term:`BSON` type has
2424
the following syntax:
2525

26-
.. versionchanged:: 3.2
27-
2826
.. code-block:: javascript
2927

3028
{ field: { $type: <BSON type> } }
@@ -68,33 +66,17 @@ For documents where ``field`` is an array, :query:`$type` returns
6866
documents in which at least one array element matches a type passed to
6967
:query:`$type`.
7068

71-
Querying for the Array BSON Type
72-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73-
74-
With MongoDB 3.6 and later, querying for ``$type: "array"`` returns
75-
documents where the field itself is an array. Prior to MongoDB 3.6,
76-
``$type: "array"`` returned documents where the field is an array
77-
containing at least one element of type ``array``. For example, given
78-
the following documents:
79-
80-
.. code-block:: javascript
81-
82-
{ "data" : [ "values", [ "values" ] ] }
83-
{ "data" : [ "values" ] }
84-
85-
With MongoDB 3.6 and later, the query
86-
``find( {"data" : { $type : "array" } } )`` returns both documents.
87-
Prior to MongoDB 3.6, the query returns only the first document.
69+
Queries for ``$type: "array"`` return documents where the field itself is
70+
an array.
8871

8972
.. _document-type-available-types:
9073

9174
Available Types
9275
~~~~~~~~~~~~~~~
9376

94-
Starting in MongoDB 3.2, :query:`$type` operator accepts string aliases
77+
The :query:`$type` operator accepts string aliases
9578
for the BSON types in addition to the numbers corresponding to the BSON
96-
types. Previous versions only accepted the numbers corresponding to the
97-
BSON type. [#type0]_
79+
types. [#type0]_
9880

9981
.. include:: /includes/fact-bson-types.rst
10082

source/reference/operator/update/position.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ Definition
3535
}
3636
}
3737

38-
.. versionchanged:: 3.6
39-
40-
:update:`$position` can accept a negative array index value to
41-
indicate the position starting from the end, counting from (but
42-
not including) the last element of the array.
43-
4438
``<num>`` indicates the position in the array, based on a zero-based index:
4539

4640
- A non-negative number corresponds to the position in the array,

0 commit comments

Comments
 (0)