Skip to content

Commit dd195d9

Browse files
authored
DOCSP-25223 Version Cleanup of Operators Reference (#1890) (#1929)
* 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 5554daf commit dd195d9

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
@@ -55,7 +55,7 @@ data types like arrays.
5555

5656
:query:`$not` operator can perform logical ``NOT`` operation on:
5757

58-
- regular expression objects (i.e. ``/pattern/``)
58+
- Regular expression objects (i.e. ``/pattern/``)
5959

6060
For example, the following query selects all documents in the
6161
``inventory`` collection where the ``item`` field value does *not*
@@ -65,7 +65,7 @@ data types like arrays.
6565

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

68-
- :query:`$regex` operator expression (Starting in MongoDB 4.0.7)
68+
- :query:`$regex` operator expression
6969

7070
For example, the following query selects all documents in the
7171
``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
@@ -93,14 +93,14 @@ Definition
9393
- boolean
9494

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

105105
For more information, see :ref:`text-operator-diacritic-sensitivity`.
106106

@@ -262,12 +262,10 @@ matches on the exact word.
262262
Case Insensitivity
263263
~~~~~~~~~~~~~~~~~~
264264

265-
.. versionchanged:: 3.2
266-
267265
The :query:`$text` operator defaults to the case insensitivity of the
268266
:doc:`text </core/index-text>` index:
269267

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

314-
.. versionchanged:: 3.2
315-
316312
The :query:`$text` operator defaults to the diacritic insensitivity of
317313
the :doc:`text </core/index-text>` index:
318314

319-
- The :ref:`version 3 text index <text-index-diacritic-insensitivity>` is
315+
- The version 3 :ref:`text index <text-index-diacritic-insensitivity>` is
320316
diacritic insensitive. That is, the index does not distinguish
321317
between characters that contain diacritical marks and their
322318
non-marked counterpart, such as ``é``, ``ê``, and ``e``.
@@ -326,11 +322,11 @@ the :doc:`text </core/index-text>` index:
326322
``$diacriticSensitive`` Option
327323
``````````````````````````````
328324

329-
To support diacritic sensitive text search against the version 3
330-
``text`` index, specify ``$diacriticSensitive: true``.
325+
To support diacritic sensitive text search against the ``text`` index,
326+
specify ``$diacriticSensitive: true``.
331327

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

@@ -351,7 +347,7 @@ Specifying ``$diacriticSensitive: true`` may impact performance.
351347

352348
To perform a diacritic sensitive search against an earlier version of
353349
the ``text`` index, the :query:`$text` operator searches the ``text``
354-
index which is diacritic sensitive.
350+
index, which is diacritic sensitive.
355351

356352
For diacritic sensitive search, if the suffix stem contains the
357353
diacritic mark or marks, the :query:`$text` operator matches on the
@@ -374,7 +370,7 @@ Examples
374370
--------
375371

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

379375
.. code-block:: javascript
380376

@@ -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)