Skip to content

Commit 736d3a4

Browse files
authored
DOCSP-25223 Version Cleanup of Operators Reference (#1890) (#1927)
* 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 6732b73 commit 736d3a4

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
@@ -188,18 +188,18 @@ field strings that match the regular expression ``"(?i)a(?-i)cme"``:
188188
``$regex`` and ``$not``
189189
```````````````````````
190190

191-
Starting in 4.0.7, :query:`$not` operator can perform logical ``NOT``
191+
The :query:`$not` operator can perform logical ``NOT``
192192
operation on both:
193193

194-
- regular expression objects (i.e. ``/pattern/``)
194+
- Regular expression objects (i.e. ``/pattern/``)
195195

196196
For example:
197197

198198
.. code-block:: javascript
199199

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

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

204204
For example:
205205

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

@@ -260,12 +260,10 @@ matches on the exact word.
260260
Case Insensitivity
261261
~~~~~~~~~~~~~~~~~~
262262

263-
.. versionchanged:: 3.2
264-
265263
The :query:`$text` operator defaults to the case insensitivity of the
266264
:doc:`text </core/index-text>` index:
267265

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

312-
.. versionchanged:: 3.2
313-
314310
The :query:`$text` operator defaults to the diacritic insensitivity of
315311
the :doc:`text </core/index-text>` index:
316312

317-
- The :ref:`version 3 text index <text-index-diacritic-insensitivity>` is
313+
- The version 3 :ref:`text index <text-index-diacritic-insensitivity>` is
318314
diacritic insensitive. That is, the index does not distinguish
319315
between characters that contain diacritical marks and their
320316
non-marked counterpart, such as ``é``, ``ê``, and ``e``.
@@ -324,11 +320,11 @@ the :doc:`text </core/index-text>` index:
324320
``$diacriticSensitive`` Option
325321
``````````````````````````````
326322

327-
To support diacritic sensitive text search against the version 3
328-
``text`` index, specify ``$diacriticSensitive: true``.
323+
To support diacritic sensitive text search against the ``text`` index,
324+
specify ``$diacriticSensitive: true``.
329325

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

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

350346
To perform a diacritic sensitive search against an earlier version of
351347
the ``text`` index, the :query:`$text` operator searches the ``text``
352-
index which is diacritic sensitive.
348+
index, which is diacritic sensitive.
353349

354350
For diacritic sensitive search, if the suffix stem contains the
355351
diacritic mark or marks, the :query:`$text` operator matches on the
@@ -372,7 +368,7 @@ Examples
372368
--------
373369

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

377373
.. code-block:: javascript
378374

@@ -533,8 +529,6 @@ languages.
533529
Case and Diacritic Insensitive Search
534530
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
535531

536-
.. versionchanged:: 3.2
537-
538532
The :query:`$text` operator defers to the case and diacritic
539533
insensitivity of the ``text`` index. The version 3 ``text`` index is
540534
diacritic insensitive and expands its case insensitivity to include the
@@ -559,7 +553,7 @@ documents.
559553
{ "_id" : 5, "subject" : "Café Con Leche", "author" : "abc", "views" : 200 }
560554
{ "_id" : 8, "subject" : "Cafe con Leche", "author" : "xyz", "views" : 10 }
561555

562-
With the previous versions of the ``text`` index, the query would not
556+
With previous versions of the ``text`` index, the query would not
563557
match any document.
564558

565559
.. seealso::
@@ -574,8 +568,6 @@ match any document.
574568
Perform Case Sensitive Search
575569
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
576570

577-
.. versionchanged:: 3.2
578-
579571
To enable case sensitive search, specify ``$caseSensitive: true``.
580572
Specifying ``$caseSensitive: true`` may impact performance.
581573

@@ -653,9 +645,7 @@ The query matches the following document:
653645
Diacritic Sensitive Search
654646
~~~~~~~~~~~~~~~~~~~~~~~~~~
655647

656-
.. versionchanged:: 3.2
657-
658-
To enable diacritic sensitive search against a version 3 :doc:`text
648+
To enable diacritic sensitive search against a version 3 :doc:`text
659649
</core/index-text>` index, specify ``$diacriticSensitive: true``.
660650
Specifying ``$diacriticSensitive: true`` may impact performance.
661651

@@ -753,7 +743,7 @@ Sort by Text Search Score
753743
.. include:: /includes/extracts/4.4-changes-projection-sort-meta-list.rst
754744

755745

756-
- In MongoDB 4.2 and earlier, to sort by the text score, include the
746+
- In MongoDB 4.2, to sort by the text score, include the
757747
**same** :expression:`$meta` expression in **both** the projection
758748
document and the sort expression. The following
759749
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)