Skip to content

Commit cc2cc99

Browse files
committed
DOCS-11691: cursor.min/cursor.max
1 parent 2834887 commit cc2cc99

File tree

5 files changed

+90
-20
lines changed

5 files changed

+90
-20
lines changed

source/reference/method/cursor.max.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ Index Bounds
6767
~~~~~~~~~~~~
6868

6969
If you use :method:`~cursor.max()` with :method:`~cursor.min()` to
70-
specify a range, the index bounds specified in
71-
:method:`~cursor.min()` and :method:`~cursor.max()`
72-
must both refer to the keys of the same index.
70+
specify a range:
71+
72+
- the index bounds specified in :method:`~cursor.min()` and
73+
:method:`~cursor.max()` must both refer to the keys of the same index.
74+
75+
- the bound specified by :method:`~cursor.max()` must be greater than
76+
the bound specified by :method:`~cursor.min()`.
77+
78+
.. versionchanged:: 4.0
7379

7480
``max()`` without ``min()``
7581
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -131,6 +137,13 @@ The collection has the following indexes:
131137
:method:`~cursor.min()` limits the query to the documents
132138
that are at or above the index key bound of ``price`` equal to
133139
``1.39``:
140+
141+
.. note::
142+
143+
.. versionchanged:: 4.0
144+
145+
The bound specified by :method:`~cursor.max()` must be greater
146+
than the bound specified by :method:`~cursor.min()`.
134147

135148
.. code-block:: javascript
136149

source/reference/method/cursor.min.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ Index Bounds
6868
~~~~~~~~~~~~
6969

7070
If you use :method:`~cursor.min()` with :method:`~cursor.max()` to
71-
specify a range, the index bounds specified in
72-
:method:`~cursor.min()` and :method:`~cursor.max()` must both refer
73-
to the keys of the same index.
71+
specify a range:
72+
73+
- the index bounds specified in :method:`~cursor.min()` and
74+
:method:`~cursor.max()` must both refer to the keys of the same index.
75+
76+
- the bound specified by :method:`~cursor.max()` must be greater than
77+
the bound specified by :method:`~cursor.min()`.
78+
79+
.. versionchanged:: 4.0
7480

7581
``min()`` without ``max()``
7682
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -136,6 +142,13 @@ The collection has the following indexes:
136142
:method:`~cursor.max()` limits the query to the documents
137143
that are below the index key bound of ``price`` equal to ``1.99``:
138144

145+
.. note::
146+
147+
.. versionchanged:: 4.0
148+
149+
The bound specified by :method:`~cursor.max()` must be greater
150+
than the bound specified by :method:`~cursor.min()`.
151+
139152
.. code-block:: javascript
140153

141154
db.products.find().min( { price: 1.39 } ).max( { price: 1.99 } ).hint( { price: 1 } )

source/reference/operator/meta/max.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ index on ``_id`` may be better.
5757
Index Bounds
5858
~~~~~~~~~~~~
5959

60-
If you use :operator:`$max` with :operator:`$min` to specify a range,
61-
the index bounds specified in :operator:`$min` and :operator:`$max`
62-
must both refer to the keys of the same index.
60+
If you use :operator:`$max` with :operator:`$min` to specify a range:
61+
62+
- the index bounds specified in :operator:`$min` and :operator:`$max`
63+
must both refer to the keys of the same index.
64+
65+
- the bound specified by :operator:`$max` must be greater than
66+
the bound specified by :operator:`$min`.
67+
68+
.. versionchanged:: 4.0
6369

6470
``$max`` without ``$min``
6571
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -116,6 +122,13 @@ Use :operator:`$max` alone or in conjunction with :operator:`$min` to
116122
limit results to a specific range for the *same* index, as in the
117123
following example:
118124

125+
.. note::
126+
127+
.. versionchanged:: 4.0
128+
129+
The bound specified by :operator:`$max` must be greater than the
130+
bound specified by :operator:`$min`.
131+
119132
.. code-block:: javascript
120133

121134
db.collection.find().min( { age: 20 } ).max( { age: 25 } )

source/reference/operator/meta/min.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ Index Bounds
5858
~~~~~~~~~~~~
5959

6060
If you use :operator:`$max` with :operator:`$min` to specify a range,
61-
the index bounds specified in :operator:`$min` and :operator:`$max`
62-
must both refer to the keys of the same index.
61+
62+
- the index bounds specified in :operator:`$min` and :operator:`$max`
63+
must both refer to the keys of the same index.
64+
65+
- the bound specified by :operator:`$max` must be greater than
66+
the bound specified by :operator:`$min`.
67+
68+
.. versionchanged:: 4.0
6369

6470
``$min`` without ``$max``
6571
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -116,6 +122,13 @@ You can use :operator:`$min` in conjunction with :operator:`$max` to
116122
limit results to a specific range for the *same* index, as in the
117123
following example:
118124

125+
.. note::
126+
127+
.. versionchanged:: 4.0
128+
129+
The bound specified by :operator:`$max` must be greater than the
130+
bound specified by :operator:`$min`.
131+
119132
.. code-block:: javascript
120133

121134
db.collection.find().min( { age: 20 } ).max( { age: 25 } )

source/release-notes/4.0-compatibility.txt

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ You cannot specify :option:`--noIndexBuildRetry <mongod
102102
:setting:`storage.indexBuildRetry` for a :binary:`~bin.mongod` instance
103103
that is part of a replica set.
104104

105+
Rollback Limit
106+
~~~~~~~~~~~~~~
107+
108+
MongoDB 4.0 removes the limit on the amount of data that can be
109+
:doc:`rolled back </core/replica-set-rollbacks>`. In previous versions,
110+
a :binary:`~bin.mongod` instance will not roll back more than 300
111+
megabytes of data and requires manual intervention if more than 300
112+
megabytes of data need to be rolled back.
113+
114+
105115
.. _4.0-compatibility-enabled:
106116

107117
``4.0`` Feature Compatibility
@@ -131,15 +141,6 @@ General
131141
option ``autoIndexId`` to ``false`` when creating collections in
132142
databases other than the ``local`` database.
133143

134-
- MongoDB 4.0 removes the limit on the amount of data that can be
135-
:doc:`rolled back </core/replica-set-rollbacks>`. In previous
136-
versions, a :binary:`~bin.mongod` instance will not roll back more than
137-
300 megabytes of data and requires manual intervention if more than
138-
300 megabytes of data need to be rolled back.
139-
140-
- MongoDB 4.0 removes the obsolete ``logUserIds`` parameter. Use
141-
:doc:`/core/auditing` instead.
142-
143144
- When :doc:`authentication </core/authentication>` is enabled, running
144145
the :dbcommand:`listDatabases` command without the
145146
:authaction:`listDatabases` action privilege returns a list of all
@@ -158,6 +159,16 @@ General
158159
:ref:`mongos <mongos>` instances. The ``transportLayer`` setting is
159160
automatically set to ``asio`` and cannot be modified.
160161

162+
``cursor.min()`` and ``cursor.max()``
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
165+
If you use :method:`~cursor.max()` with :method:`~cursor.min()` to
166+
specify a range, the bound specified by :method:`~cursor.max()` must be
167+
greater than the bound specified by :method:`~cursor.min()`.
168+
169+
In previous versions, the bounds could be equal but would scan no index
170+
entries, always resulting in an empty result set.
171+
161172
Disable TLS 1.0
162173
---------------
163174

@@ -217,6 +228,13 @@ As alternatives, users can:
217228
If the input collection is sharded, all documents for that collection
218229
must be able to fit on the output collection's shard.
219230

231+
Parameters
232+
~~~~~~~~~~
233+
234+
- MongoDB removes the obsolete ``logUserIds`` parameter. Use
235+
:doc:`/core/auditing` instead.
236+
237+
220238
.. _4.0-remove-isolated:
221239

222240
``$isolated`` Operator

0 commit comments

Comments
 (0)