Skip to content

Commit a342340

Browse files
(DOCSP-18984): Add additional versioned api limitations (#452)
Co-authored-by: Jeff Allen <[email protected]>
1 parent 7ae0832 commit a342340

File tree

7 files changed

+118
-25
lines changed

7 files changed

+118
-25
lines changed

source/core/capped-collections.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ Transactions
139139

140140
.. include:: /includes/extracts/transactions-capped-collection-change.rst
141141

142+
Versioned API
143+
~~~~~~~~~~~~~
144+
145+
Capped collections are not supported in :ref:`Versioned API
146+
<versioned-api>` V1.
147+
142148
Procedures
143149
----------
144150

source/reference/command/aggregate.txt

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ arguments:
8585

8686
- An array of :doc:`aggregation pipeline stages
8787
</reference/operator/aggregation-pipeline>` that process and
88-
transform the document stream as part of the aggregation pipeline.
89-
90-
88+
transform the document stream as part of the aggregation
89+
pipeline.
9190

9291
* - ``explain``
9392

@@ -309,22 +308,39 @@ For :dbcommand:`aggregate` operation that do not include the
309308

310309
.. include:: /includes/extracts/4.2-changes-disconnect.rst
311310

311+
Versioned API
312+
-------------
313+
314+
When using :ref:`Versioned API <versioned-api>` V1:
315+
316+
- You cannot use the following stages in an :dbcommand:`aggregate`
317+
command:
318+
319+
- :pipeline:`$currentOp`
320+
- :pipeline:`$indexStats`
321+
- :pipeline:`$listLocalSessions`
322+
- :pipeline:`$listSessions`
323+
- :pipeline:`$planCacheStats`
324+
- :pipeline:`$search`
325+
326+
- When using the :pipeline:`$collStats` stage, you can only use the
327+
``count`` field. No other :pipeline:`$collStats` fields are
328+
available.
329+
312330
Example
313331
-------
314332

315-
.. versionchanged:: 3.4
316-
317-
.. include:: /includes/deprecation-aggregate-wo-cursor.rst
333+
.. include:: /includes/deprecation-aggregate-wo-cursor.rst
318334

319-
Rather than run the :dbcommand:`aggregate` command directly, most
320-
users should use the :method:`db.collection.aggregate()` helper
321-
provided in :binary:`~bin.mongosh` or the equivalent helper in
322-
their driver. In 2.6 and later, the
323-
:method:`db.collection.aggregate()` helper always returns a cursor.
335+
Rather than run the :dbcommand:`aggregate` command directly, most
336+
users should use the :method:`db.collection.aggregate()` helper
337+
provided in :binary:`~bin.mongosh` or the equivalent helper in
338+
their driver. In 2.6 and later, the
339+
:method:`db.collection.aggregate()` helper always returns a cursor.
324340

325-
Except for the first two examples which demonstrate the command
326-
syntax, the examples in this page use the
327-
:method:`db.collection.aggregate()` helper.
341+
Except for the first two examples which demonstrate the command
342+
syntax, the examples in this page use the
343+
:method:`db.collection.aggregate()` helper.
328344

329345
Aggregate Data with Multi-Stage Pipeline
330346
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source/reference/command/create.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,21 @@ Transactions
400400

401401
.. |operation| replace:: :dbcommand:`create`
402402

403+
Versioned API
404+
~~~~~~~~~~~~~
405+
406+
.. versionchanged:: 5.0
407+
408+
When using :ref:`Versioned API <versioned-api>` V1, you cannot specify
409+
the following fields in a :dbcommand:`create` command:
410+
411+
- ``autoIndexId``
412+
- ``capped``
413+
- ``indexOptionDefaults``
414+
- ``max``
415+
- ``size``
416+
- ``storageEngine``
417+
403418
Access Control
404419
--------------
405420

source/reference/command/createIndexes.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,21 @@ Collation and Index Types
594594

595595
.. include:: /includes/extracts/collation-index-type-restrictions-addendum.rst
596596

597+
Versioned API
598+
~~~~~~~~~~~~~
599+
600+
When using :ref:`Versioned API <versioned-api>` V1:
601+
602+
- You cannot specify any of the following fields in the ``indexes`` array:
603+
604+
- ``background``
605+
- ``bucketSize``
606+
- ``sparse``
607+
- ``storageEngine``
608+
609+
- You cannot create :ref:`geoHaystack <index-geohaystack-index>` or
610+
:ref:`text <index-feature-text>` indexes.
611+
597612
Behavior
598613
--------
599614

source/reference/command/find.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,21 @@ Client Disconnection
545545

546546
.. include:: /includes/extracts/4.2-changes-disconnect.rst
547547

548+
Versioned API
549+
~~~~~~~~~~~~~
550+
551+
When using :ref:`Versioned API <versioned-api>` V1, the following
552+
:dbcommand:`find` command fields are not supported:
553+
554+
- ``awaitData``
555+
- ``max``
556+
- ``min``
557+
- ``noCursorTimeout``
558+
- ``oplogReplay``
559+
- ``returnKey``
560+
- ``showRecordId``
561+
- ``tailable``
562+
548563

549564
Examples
550565
--------

source/reference/command/setParameter.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ setParameter
1010
:depth: 1
1111
:class: singlecol
1212

13-
.. note::
14-
15-
Commands issued by the admin command :dbcommand:`setParameter`
16-
do not survive server restarts. For a persistent option use the
17-
:option:`--setParameter <mongod --setParameter>` command line option
18-
or the :setting:`setParameter` configuration file setting.
13+
Definition
14+
----------
1915

2016

2117
.. dbcommand:: setParameter
@@ -32,3 +28,20 @@ setParameter
3228
For the available parameters, including examples, see
3329
:doc:`/reference/parameters`.
3430

31+
Behavior
32+
--------
33+
34+
Persistence
35+
~~~~~~~~~~~
36+
37+
Commands issued by the admin command :dbcommand:`setParameter`
38+
do not survive server restarts. For a persistent option use the
39+
:option:`--setParameter <mongod --setParameter>` command line option
40+
or the :setting:`setParameter` configuration file setting.
41+
42+
Versioned API
43+
~~~~~~~~~~~~~
44+
45+
When using :ref:`Versioned API <versioned-api>` V1 with :ref:`apiStrict
46+
<api-strict-desc>` set to ``true``, you cannot use
47+
:dbcommand:`setParameter` to modify server parameters.

source/reference/versioned-api.txt

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _versioned-api:
2+
13
=============
24
Versioned API
35
=============
@@ -375,19 +377,19 @@ API V1 protects you from API-breaking changes
375377
for the following commands:
376378

377379
- :dbcommand:`abortTransaction`
378-
- :dbcommand:`aggregate`
380+
- :dbcommand:`aggregate` (with limitations) [#versioned-api-command-limitations]_
379381
- :dbcommand:`authenticate`
380382
- :dbcommand:`collMod`
381383
- :dbcommand:`commitTransaction`
382-
- :dbcommand:`create`
383-
- :dbcommand:`createIndexes`
384+
- :dbcommand:`create` (with limitations) [#versioned-api-command-limitations]_
385+
- :dbcommand:`createIndexes` (with limitations) [#versioned-api-command-limitations]_
384386
- :dbcommand:`delete`
385387
- :dbcommand:`drop`
386388
- :dbcommand:`dropDatabase`
387389
- :dbcommand:`dropIndexes`
388390
- :dbcommand:`endSessions`
389-
- :dbcommand:`explain`
390-
- :dbcommand:`find`
391+
- :dbcommand:`explain` (with limitations) [#versioned-api-explain]_
392+
- :dbcommand:`find` (with limitations) [#versioned-api-command-limitations]_
391393
- :dbcommand:`findAndModify`
392394
- :dbcommand:`getMore`
393395
- :dbcommand:`insert`
@@ -400,6 +402,17 @@ for the following commands:
400402
- :dbcommand:`refreshSessions`
401403
- :dbcommand:`update`
402404

405+
.. [#versioned-api-command-limitations]
406+
407+
API V1 may not support all available options for these commands.
408+
Refer to the specific command documentation for limitations specific
409+
to API V1.
410+
411+
.. [#versioned-api-explain]
412+
413+
MongoDB does not guarantee that the output of the
414+
:dbcommand:`explain` command will conform to the same format in
415+
future API versions.
403416

404417
Parameters
405418
----------

0 commit comments

Comments
 (0)