diff --git a/source/includes/driver-examples/versioned-api-java-example.java b/source/includes/driver-examples/versioned-api-java-example.java index 353e1316081..6e6ccbd82a6 100644 --- a/source/includes/driver-examples/versioned-api-java-example.java +++ b/source/includes/driver-examples/versioned-api-java-example.java @@ -28,7 +28,7 @@ private static MongoClient setApiVersionStrict(String connectionString) { ); return client; - // Start Versioned API Example 2 + // End Versioned API Example 2 } private static MongoClient setApiVersionNotStrict(String connectionString) { diff --git a/source/reference/versioned-api.txt b/source/reference/versioned-api.txt index a7a7d196028..66253bd562f 100644 --- a/source/reference/versioned-api.txt +++ b/source/reference/versioned-api.txt @@ -131,6 +131,15 @@ application's MongoClient: :start-after: Start Versioned API Example 1 :end-before: End Versioned API Example 1 + .. tab:: + :tabid: java-sync + + .. literalinclude:: /includes/driver-examples/versioned-api-java-example.java + :language: java-sync + :dedent: 4 + :start-after: Start Versioned API Example 1 + :end-before: End Versioned API Example 1 + ``"1"`` is currently the only API version available. By default, clients are *non-strict*. A non-strict client allows you @@ -209,6 +218,15 @@ Use the sample code to create a *strict* client: :start-after: Start Versioned API Example 2 :end-before: End Versioned API Example 2 + .. tab:: + :tabid: java-sync + + .. literalinclude:: /includes/driver-examples/versioned-api-java-example.java + :language: java-sync + :dedent: 4 + :start-after: Start Versioned API Example 2 + :end-before: End Versioned API Example 2 + Migrate To Versioned API Commands --------------------------------- @@ -359,6 +377,15 @@ Use the sample code to create a *non-strict* client: :start-after: Start Versioned API Example 3 :end-before: End Versioned API Example 3 + .. tab:: + :tabid: java-sync + + .. literalinclude:: /includes/driver-examples/versioned-api-java-example.java + :language: java-sync + :dedent: 4 + :start-after: Start Versioned API Example 3 + :end-before: End Versioned API Example 3 + Using this non-strict client allows you to run commands outside of the Versioned API. For example, this non-strict client now allows you to use the :dbcommand:`count` command once again.