1- =============
2- Versioned API
3- =============
1+ .. _versioned-api-java:
2+ .. _stable-api-java:
3+
4+ ==============
5+ {+stable-api+}
6+ ==============
47
58.. default-domain:: mongodb
69
@@ -10,68 +13,66 @@ Versioned API
1013 :depth: 1
1114 :class: singlecol
1215
13- .. _versioned-api-java:
14-
1516.. note::
1617
17- The Versioned API feature requires MongoDB Server 5.0 or later.
18+ The {+stable-api+} feature requires MongoDB Server 5.0 or later.
1819
19- You should only use the Versioned API feature if all the MongoDB
20+ You should only use the {+stable-api+} feature if all the MongoDB
2021 servers you are connecting to support this feature.
2122
2223Overview
2324--------
2425
25- In this guide, you can learn how to specify the **Versioned API ** when connecting to
26- a MongoDB instance or replica set. You can use the Versioned API feature to
26+ In this guide, you can learn how to specify the **{+stable-api+} ** when connecting to
27+ a MongoDB instance or replica set. You can use the {+stable-api+} feature to
2728force the server to run operations with behavior compatible with the
2829specified **API version**. An API version defines the expected behavior of the
2930operations it covers and the format of server responses. If you change to
3031a different API version, the operations are not guaranteed to be
3132compatible and the server responses are not guaranteed to be similar.
3233
33- When you use the Versioned API feature with an official MongoDB driver, you
34+ When you use the {+stable-api+} feature with an official MongoDB driver, you
3435can update your driver or server without worrying about backward compatibility
35- issues of the commands covered by the Versioned API .
36+ issues of the commands covered by the {+stable-api+} .
3637
37- See the server manual page on the `Versioned API <https://docs.mongodb.com/v5.0/ reference/versioned -api/>`__
38+ See the MongoDB reference page on the :manual:`{+stable-api+} </ reference/stable -api/>`
3839for more information including a list of commands it covers.
3940
40- The following sections describe how you can enable the Versioned API for
41+ The following sections describe how you can enable the {+stable-api+} for
4142your MongoDB client and the options that you can specify.
4243
43- Enable the Versioned API on a MongoDB Client
44- --------------------------------------------
44+ Enable the {+stable-api+} on a MongoDB Client
45+ ---------------------------------------------
4546
46- To enable the Versioned API , you must specify an API version in the settings
47+ To enable the {+stable-api+} , you must specify an API version in the settings
4748of your MongoDB client. Once you instantiate a ``MongoClient`` instance with
4849a specified API version, all commands you run with that client use that
49- version of the Versioned API .
50+ version of the {+stable-api+} .
5051
5152.. tip::
5253
53- If you need to run commands using more than one version of the Versioned
54- API , instantiate a separate client with that version.
54+ If you need to run commands using more than one version of the
55+ {+stable-api+} , instantiate a separate client with that version.
5556
56- If you need to run commands not covered by the Versioned API , make sure the
57+ If you need to run commands not covered by the {+stable-api+} , make sure the
5758 "strict" option is disabled. See the section on
58- :ref:`Versioned API Options <versioned -api-options>` for more information.
59+ :ref:`{+stable-api+} Options <stable -api-options>` for more information.
5960
6061The following example shows how you can instantiate a ``MongoClient`` that
61- sets the Versioned API version and connects to a server by performing the
62+ sets the {+stable-api+} version and connects to a server by performing the
6263following operations:
6364
6465- Construct a ``ServerApi`` instance using the ``ServerApi.Builder``
6566 helper class.
66- - Specify a Versioned API version using a constant from the
67+ - Specify a {+stable-api+} version using a constant from the
6768 ``ServerApiVersion`` class.
6869- Construct a ``MongoClientSettings`` instance using the
6970 ``MongoClientSettings.Builder`` class.
7071- Specify a server to connect to using a ``ServerAddress`` instance.
7172- Instantiate a ``MongoClient`` using the ``MongoClients.create()`` method
7273 and pass your ``MongoClientSettings`` instance as a parameter.
7374
74- .. literalinclude:: /includes/fundamentals/code-snippets/VersionedApiExample .java
75+ .. literalinclude:: /includes/fundamentals/code-snippets/StableApiExample .java
7576 :start-after: start serverAPIVersion
7677 :end-before: end serverAPIVersion
7778 :language: java
@@ -80,7 +81,7 @@ following operations:
8081.. warning::
8182
8283 If you specify an API version and connect to a MongoDB server that does
83- not support the Versioned API , your application may raise an exception when
84+ not support the {+stable-api+} , your application may raise an exception when
8485 executing a command on your MongoDB server. If you use a ``MongoClient``
8586 that specifies the API version to query a server that does not support it,
8687 your query could fail with an exception message that includes the
@@ -104,11 +105,12 @@ section, see the following API Documentation:
104105- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__
105106
106107.. _versioned-api-options:
108+ .. _stable-api-options:
107109
108- Versioned API Options
109- ---------------------
110+ {+stable-api+} Options
111+ --------------------------
110112
111- You can enable or disable optional behavior related to the Versioned API as
113+ You can enable or disable optional behavior related to the {+stable-api+} as
112114described in the following table.
113115
114116.. list-table::
@@ -132,7 +134,7 @@ described in the following table.
132134The following example shows how you can set the two options on an instance
133135of ``ServerApi`` by chaining methods on the ``ServerApi.Builder``:
134136
135- .. literalinclude:: /includes/fundamentals/code-snippets/VersionedApiExample .java
137+ .. literalinclude:: /includes/fundamentals/code-snippets/StableApiExample .java
136138 :start-after: start apiVersionOptions
137139 :end-before: end apiVersionOptions
138140 :language: java
0 commit comments