1
- .. _versioned -api:
1
+ .. _stable -api:
2
2
3
- =============
4
- Versioned API
5
- =============
3
+ ==========
4
+ Stable API
5
+ ==========
6
6
7
7
.. default-domain:: mongodb
8
8
@@ -12,19 +12,19 @@ Versioned API
12
12
:depth: 1
13
13
:class: singlecol
14
14
15
- What is the Versioned API, and Should You Use It?
16
- -------------------------------------------------
15
+ What is the Stable API, and Should You Use It?
16
+ ----------------------------------------------
17
17
18
- The MongoDB Versioned API lets you upgrade your MongoDB server at will,
19
- and ensure that behavior changes between MongoDB versions do not break
20
- your application.
18
+ The MongoDB Stable API (previously labeled the Versioned API) lets you
19
+ upgrade your MongoDB server at will, and ensure that behavior changes
20
+ between MongoDB versions do not break your application.
21
21
22
- MongoDB 5.0 introduces the Versioned API for applications
23
- communicating with MongoDB server products. The Versioned API allows
22
+ MongoDB 5.0 introduces the Stable API for applications
23
+ communicating with MongoDB server products. The Stable API allows
24
24
you to specify which version of the MongoDB API your application
25
25
runs against.
26
26
27
- The Versioned API provides long-term API stability for applications
27
+ The Stable API provides long-term API stability for applications
28
28
and supports more frequent releases and automatic server upgrades. This
29
29
allows your applications to take advantage of rapidly released
30
30
features without risking backwards-breaking changes.
@@ -33,11 +33,17 @@ The default behavior for your driver connection will continue to
33
33
function as expected, even if you do not explicitly specify
34
34
an :ref:`apiVersion <api-version-desc>`.
35
35
36
- The Versioned API encompasses the
36
+ The Stable API encompasses the
37
37
:ref:`subset of MongoDB commands <api-v1-command-list>` that
38
38
applications use to read and write data, create collections
39
39
and indexes, and perform other common tasks.
40
40
41
+ .. note::
42
+
43
+ Starting in Feburary 2022, the "Versioned API" terminology was
44
+ changed to "Stable API". All concepts and features remain the same
45
+ with this naming change.
46
+
41
47
Backward Compatibility Guarantee
42
48
--------------------------------
43
49
@@ -63,7 +69,7 @@ upper-right to set the language of the examples on this page.
63
69
64
70
----------
65
71
66
- To use the Versioned API, upgrade to the latest driver and create your
72
+ To use the Stable API, upgrade to the latest driver and create your
67
73
application's MongoClient:
68
74
69
75
.. tabs-selector:: drivers
@@ -134,7 +140,7 @@ application's MongoClient:
134
140
.. tab::
135
141
:tabid: java-sync
136
142
137
- .. literalinclude:: /includes/driver-examples/versioned -api-java-example.java
143
+ .. literalinclude:: /includes/driver-examples/stable -api-java-example.java
138
144
:language: java-sync
139
145
:dedent: 4
140
146
:start-after: Start Versioned API Example 1
@@ -144,13 +150,13 @@ application's MongoClient:
144
150
145
151
By default, clients are *non-strict*. A non-strict client allows you
146
152
to run any command, regardless of whether or not it belongs to the
147
- Versioned API.
153
+ Stable API.
148
154
149
155
Create a Strict Client
150
156
----------------------
151
157
152
- A *strict* client rejects all commands outside of the Versioned API.
153
- Attempts to use commands outside of the Versioned API will receive the
158
+ A *strict* client rejects all commands outside of the Stable API.
159
+ Attempts to use commands outside of the Stable API will receive the
154
160
:ref:`APIVersionError <api-vers-resp>` response.
155
161
156
162
Use the sample code to create a *strict* client:
@@ -221,24 +227,24 @@ Use the sample code to create a *strict* client:
221
227
.. tab::
222
228
:tabid: java-sync
223
229
224
- .. literalinclude:: /includes/driver-examples/versioned -api-java-example.java
230
+ .. literalinclude:: /includes/driver-examples/stable -api-java-example.java
225
231
:language: java-sync
226
232
:dedent: 4
227
233
:start-after: Start Versioned API Example 2
228
234
:end-before: End Versioned API Example 2
229
235
230
- Migrate To Versioned API Commands
231
- ---------------------------------
236
+ Migrate To Stable API Commands
237
+ ------------------------------
232
238
233
- To migrate your application to use the Versioned API, you must:
239
+ To migrate your application to use the Stable API, you must:
234
240
235
241
#. Run your application's test suite with the new MongoClient options.
236
242
#. Determine which commands and features you're using that are outside
237
- of the Versioned API.
238
- #. Migrate to alternative commands and features in the Versioned API.
243
+ of the Stable API.
244
+ #. Migrate to alternative commands and features in the Stable API.
239
245
240
246
Once your application uses only commands and features defined in the
241
- Versioned API, you can redeploy it with the new MongoClient options
247
+ Stable API, you can redeploy it with the new MongoClient options
242
248
and be confident that future server upgrades won't negatively
243
249
impact your application.
244
250
@@ -248,7 +254,7 @@ Example: :dbcommand:`count` Migration
248
254
This example shows how to migrate an application that implements the
249
255
:dbcommand:`count` command to an alternative method of counting
250
256
documents. Since the :dbcommand:`count` command does not belong to the
251
- Versioned API, this application cannot use the Versioned API until the
257
+ Stable API, this application cannot use the Stable API until the
252
258
:dbcommand:`count` command is removed from the code.
253
259
254
260
Use the sample code to create a ``sales`` collection in
@@ -267,8 +273,8 @@ Use the sample code to create a ``sales`` collection in
267
273
{ "_id" : 8, "item" : "abc", "price" : 10, "quantity" : 5, "date" : ISODate("2021-03-16T20:20:13Z") }
268
274
])
269
275
270
- Versioned API Error Response
271
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276
+ Stable API Error Response
277
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
272
278
273
279
For example, issuing ``db.sales.count()`` results in this error:
274
280
@@ -283,7 +289,7 @@ For example, issuing ``db.sales.count()`` results in this error:
283
289
}
284
290
285
291
However, the :dbcommand:`aggregate` command is
286
- :ref:`in the Versioned API <api-v1-command-list>` and can be used to
292
+ :ref:`in the Stable API <api-v1-command-list>` and can be used to
287
293
obtain a count. Use the sample code to obtain a count from the ``sales``
288
294
collection in :binary:`~bin.mongosh`:
289
295
@@ -305,10 +311,10 @@ number of documents in the collection:
305
311
306
312
{ "_id" : null, "count" : 8 }
307
313
308
- How To Use Commands and Features Outside of the Versioned API
309
- -------------------------------------------------------------
314
+ How To Use Commands and Features Outside of the Stable API
315
+ ----------------------------------------------------------
310
316
311
- To use commands and features outside of the Versioned API, you can
317
+ To use commands and features outside of the Stable API, you can
312
318
connect to your deployment with a *non-strict* client. By default,
313
319
clients are *non-strict*.
314
320
@@ -380,19 +386,19 @@ Use the sample code to create a *non-strict* client:
380
386
.. tab::
381
387
:tabid: java-sync
382
388
383
- .. literalinclude:: /includes/driver-examples/versioned -api-java-example.java
389
+ .. literalinclude:: /includes/driver-examples/stable -api-java-example.java
384
390
:language: java-sync
385
391
:dedent: 4
386
392
:start-after: Start Versioned API Example 3
387
393
:end-before: End Versioned API Example 3
388
394
389
395
Using this non-strict client allows you to run commands outside of the
390
- Versioned API. For example, this non-strict client now allows you to
396
+ Stable API. For example, this non-strict client now allows you to
391
397
use the :dbcommand:`count` command once again.
392
398
393
399
.. important::
394
400
395
- Commands and features outside of the Versioned API do not have the same
401
+ Commands and features outside of the Stable API do not have the same
396
402
backward compatibility guarantees as versioned alternatives.
397
403
398
404
.. _api-v1-command-list:
@@ -404,19 +410,19 @@ API V1 protects you from API-breaking changes
404
410
for the following commands:
405
411
406
412
- :dbcommand:`abortTransaction`
407
- - :dbcommand:`aggregate` (with limitations) [#versioned -api-command-limitations]_
413
+ - :dbcommand:`aggregate` (with limitations) [#stable -api-command-limitations]_
408
414
- :dbcommand:`authenticate`
409
415
- :dbcommand:`collMod`
410
416
- :dbcommand:`commitTransaction`
411
- - :dbcommand:`create` (with limitations) [#versioned -api-command-limitations]_
412
- - :dbcommand:`createIndexes` (with limitations) [#versioned -api-command-limitations]_
417
+ - :dbcommand:`create` (with limitations) [#stable -api-command-limitations]_
418
+ - :dbcommand:`createIndexes` (with limitations) [#stable -api-command-limitations]_
413
419
- :dbcommand:`delete`
414
420
- :dbcommand:`drop`
415
421
- :dbcommand:`dropDatabase`
416
422
- :dbcommand:`dropIndexes`
417
423
- :dbcommand:`endSessions`
418
- - :dbcommand:`explain` (with limitations) [#versioned -api-explain]_
419
- - :dbcommand:`find` (with limitations) [#versioned -api-command-limitations]_
424
+ - :dbcommand:`explain` (with limitations) [#stable -api-explain]_
425
+ - :dbcommand:`find` (with limitations) [#stable -api-command-limitations]_
420
426
- :dbcommand:`findAndModify`
421
427
- :dbcommand:`getMore`
422
428
- :dbcommand:`insert`
@@ -429,13 +435,13 @@ for the following commands:
429
435
- :dbcommand:`refreshSessions`
430
436
- :dbcommand:`update`
431
437
432
- .. [#versioned -api-command-limitations]
438
+ .. [#stable -api-command-limitations]
433
439
434
440
API V1 may not support all available options for these commands.
435
441
Refer to the specific command documentation for limitations specific
436
442
to API V1.
437
443
438
- .. [#versioned -api-explain]
444
+ .. [#stable -api-explain]
439
445
440
446
MongoDB does not guarantee that the output of the
441
447
:dbcommand:`explain` command will conform to the same format in
@@ -444,7 +450,7 @@ for the following commands:
444
450
Parameters
445
451
----------
446
452
447
- You can specify the following optional parameters for Versioned API in
453
+ You can specify the following optional parameters for Stable API in
448
454
your application's MongoDB driver connection code. Check the MongoDB
449
455
driver documentation for the driver you use in your application for
450
456
more information:
@@ -514,7 +520,7 @@ ignored.
514
520
API Error Responses
515
521
~~~~~~~~~~~~~~~~~~~
516
522
517
- This table shows error responses for problematic Versioned API requests.
523
+ This table shows error responses for problematic Stable API requests.
518
524
519
525
.. list-table::
520
526
:widths: 25,75
@@ -558,4 +564,4 @@ This table shows error responses for problematic Versioned API requests.
558
564
:titlesonly:
559
565
:hidden:
560
566
561
- /reference/versioned -api-reference
567
+ /reference/stable -api-reference
0 commit comments