Skip to content

(DOCSP-18984): Add additional versioned api limitations #6086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/core/capped-collections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ Transactions

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

Versioned API
~~~~~~~~~~~~~

Capped collections are not supported in :ref:`Versioned API
<versioned-api>` V1.

Procedures
----------

Expand Down
44 changes: 30 additions & 14 deletions source/reference/command/aggregate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ arguments:

- An array of :doc:`aggregation pipeline stages
</reference/operator/aggregation-pipeline>` that process and
transform the document stream as part of the aggregation pipeline.


transform the document stream as part of the aggregation
pipeline.

* - ``explain``

Expand Down Expand Up @@ -308,22 +307,39 @@ For :dbcommand:`aggregate` operation that do not include the

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

Versioned API
-------------

When using :ref:`Versioned API <versioned-api>` V1:

- You cannot use the following stages in an :dbcommand:`aggregate`
command:

- :pipeline:`$currentOp`
- :pipeline:`$indexStats`
- :pipeline:`$listLocalSessions`
- :pipeline:`$listSessions`
- :pipeline:`$planCacheStats`
- :pipeline:`$search`

- When using the :pipeline:`$collStats` stage, you can only use the
``count`` field. No other :pipeline:`$collStats` fields are
available.

Example
-------

.. versionchanged:: 3.4

.. include:: /includes/deprecation-aggregate-wo-cursor.rst
.. include:: /includes/deprecation-aggregate-wo-cursor.rst

Rather than run the :dbcommand:`aggregate` command directly, most
users should use the :method:`db.collection.aggregate()` helper
provided in :binary:`~bin.mongosh` or the equivalent helper in
their driver. In 2.6 and later, the
:method:`db.collection.aggregate()` helper always returns a cursor.
Rather than run the :dbcommand:`aggregate` command directly, most
users should use the :method:`db.collection.aggregate()` helper
provided in :binary:`~bin.mongosh` or the equivalent helper in
their driver. In 2.6 and later, the
:method:`db.collection.aggregate()` helper always returns a cursor.

Except for the first two examples which demonstrate the command
syntax, the examples in this page use the
:method:`db.collection.aggregate()` helper.
Except for the first two examples which demonstrate the command
syntax, the examples in this page use the
:method:`db.collection.aggregate()` helper.

Aggregate Data with Multi-Stage Pipeline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
15 changes: 15 additions & 0 deletions source/reference/command/create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,21 @@ Transactions

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

Versioned API
~~~~~~~~~~~~~

.. versionchanged:: 5.0

When using :ref:`Versioned API <versioned-api>` V1, you cannot specify
the following fields in a :dbcommand:`create` command:

- ``autoIndexId``
- ``capped``
- ``indexOptionDefaults``
- ``max``
- ``size``
- ``storageEngine``

Access Control
--------------

Expand Down
15 changes: 15 additions & 0 deletions source/reference/command/createIndexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,21 @@ Collation and Index Types

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

Versioned API
~~~~~~~~~~~~~

When using :ref:`Versioned API <versioned-api>` V1:

- You cannot specify any of the following fields in the ``indexes`` array:

- ``background``
- ``bucketSize``
- ``sparse``
- ``storageEngine``

- You cannot create :ref:`geoHaystack <index-geohaystack-index>` or
:ref:`text <index-feature-text>` indexes.

Behavior
--------

Expand Down
15 changes: 15 additions & 0 deletions source/reference/command/find.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,21 @@ Client Disconnection

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

Versioned API
~~~~~~~~~~~~~

When using :ref:`Versioned API <versioned-api>` V1, the following
:dbcommand:`find` command fields are not supported:

- ``awaitData``
- ``max``
- ``min``
- ``noCursorTimeout``
- ``oplogReplay``
- ``returnKey``
- ``showRecordId``
- ``tailable``


Examples
--------
Expand Down
25 changes: 19 additions & 6 deletions source/reference/command/setParameter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ setParameter
:depth: 1
:class: singlecol

.. note::

Commands issued by the admin command :dbcommand:`setParameter`
do not survive server restarts. For a persistent option use the
:option:`--setParameter <mongod --setParameter>` command line option
or the :setting:`setParameter` configuration file setting.
Definition
----------


.. dbcommand:: setParameter
Expand All @@ -32,3 +28,20 @@ setParameter
For the available parameters, including examples, see
:doc:`/reference/parameters`.

Behavior
--------

Persistence
~~~~~~~~~~~

Commands issued by the admin command :dbcommand:`setParameter`
do not survive server restarts. For a persistent option use the
:option:`--setParameter <mongod --setParameter>` command line option
or the :setting:`setParameter` configuration file setting.

Versioned API
~~~~~~~~~~~~~

When using :ref:`Versioned API <versioned-api>` V1 with :ref:`apiStrict
<api-strict-desc>` set to ``true``, you cannot use
:dbcommand:`setParameter` to modify server parameters.
23 changes: 18 additions & 5 deletions source/reference/versioned-api.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _versioned-api:

=============
Versioned API
=============
Expand Down Expand Up @@ -375,19 +377,19 @@ API V1 protects you from API-breaking changes
for the following commands:

- :dbcommand:`abortTransaction`
- :dbcommand:`aggregate`
- :dbcommand:`aggregate` (with limitations) [#versioned-api-command-limitations]_
- :dbcommand:`authenticate`
- :dbcommand:`collMod`
- :dbcommand:`commitTransaction`
- :dbcommand:`create`
- :dbcommand:`createIndexes`
- :dbcommand:`create` (with limitations) [#versioned-api-command-limitations]_
- :dbcommand:`createIndexes` (with limitations) [#versioned-api-command-limitations]_
- :dbcommand:`delete`
- :dbcommand:`drop`
- :dbcommand:`dropDatabase`
- :dbcommand:`dropIndexes`
- :dbcommand:`endSessions`
- :dbcommand:`explain`
- :dbcommand:`find`
- :dbcommand:`explain` (with limitations) [#versioned-api-explain]_
- :dbcommand:`find` (with limitations) [#versioned-api-command-limitations]_
- :dbcommand:`findAndModify`
- :dbcommand:`getMore`
- :dbcommand:`insert`
Expand All @@ -400,6 +402,17 @@ for the following commands:
- :dbcommand:`refreshSessions`
- :dbcommand:`update`

.. [#versioned-api-command-limitations]

API V1 may not support all available options for these commands.
Refer to the specific command documentation for limitations specific
to API V1.

.. [#versioned-api-explain]

MongoDB does not guarantee that the output of the
:dbcommand:`explain` command will conform to the same format in
future API versions.

Parameters
----------
Expand Down