Skip to content

020724 fix indentation #520

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 3 commits into from
Feb 7, 2024
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
126 changes: 58 additions & 68 deletions source/connection-troubleshooting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@ Connection Troubleshooting

.. note::

This page addresses only connection issues. If you encounter other
issues with MongoDB or the driver, visit the following resources:

- The :ref:`Issues & Help <java-issues-and-help>` topic for
information about reporting bugs, contributing to the driver, and
finding more resources
- The `MongoDB Community Forums <{+communityForums+}>`__ for
questions, discussions, or general technical support
- The :ref:`Frequently Asked Questions (FAQ) <java-faq>` section for
common questions and corresponding answers about the
{+driver-short+}
Test

.. replacement:: server-selection-timeout-error

Expand All @@ -60,109 +50,109 @@ Connection Troubleshooting

.. _java-authentication-error:

.. replacement:: scram-failure-error
.. replacement:: scram-failure-error

.. code-block:: none
:copyable: false
.. code-block:: none
:copyable: false

Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:27017.
Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:27017.

.. replacement:: check-credentials-formatting-anchor
.. replacement:: check-credentials-formatting-anchor

.. _java-connection-string-auth:
.. _java-connection-string-auth:

.. replacement:: learn-more-connection-string-admonition
.. replacement:: learn-more-connection-string-admonition

.. tip::
.. tip::

For more information about using connection strings,
see :ref:`Connection URI <connection-uri>` in the Connection Guide.
For more information about using connection strings,
see :ref:`Connection URI <connection-uri>` in the Connection Guide.

.. replacement:: verify-authentication-database-anchor
.. replacement:: verify-authentication-database-anchor

.. _java-verify-auth-db:
.. _java-verify-auth-db:

.. replacement:: authsource-param-code-block
.. replacement:: authsource-param-code-block

.. code-block:: java
:copyable: false
.. code-block:: java
:copyable: false

String uri = "mongodb://<username>:<password>@<hostname>:<port>/?authSource=users&authMechanism=SCRAM-SHA-256";
MongoClient mongoClient = MongoClients.create(uri);
String uri = "mongodb://<username>:<password>@<hostname>:<port>/?authSource=users&authMechanism=SCRAM-SHA-256";
MongoClient mongoClient = MongoClients.create(uri);

.. replacement:: credentials-provider-alternative-method-description
.. replacement:: credentials-provider-alternative-method-description

If you construct a client by using a ``MongoCredential``, the builder method
corresponds to the authentication mechanism. The following code shows the builder
method for the ``SCRAM-SHA-256`` authentication mechanism:
If you construct a client by using a ``MongoCredential``, the builder method
corresponds to the authentication mechanism. The following code shows the builder
method for the ``SCRAM-SHA-256`` authentication mechanism:

.. code-block:: java
:copyable: false
.. code-block:: java
:copyable: false

MongoCredential credential = MongoCredential.createScramSha256Credential("<username>", "<authenticationDb>", "<password>");
MongoCredential credential = MongoCredential.createScramSha256Credential("<username>", "<authenticationDb>", "<password>");


.. replacement:: authentication-guide-reference
.. replacement:: authentication-guide-reference

To learn more about specifying authentication mechanisms, see the :ref:`authentication-mechanisms` and
:ref:`enterprise-authentication-mechanisms` guides.
To learn more about specifying authentication mechanisms, see the :ref:`authentication-mechanisms` and
:ref:`enterprise-authentication-mechanisms` guides.

.. replacement:: verify-authentication-mechanism-anchor
.. replacement:: verify-authentication-mechanism-anchor

.. _java-verify-auth-mechanism:
.. _java-verify-auth-mechanism:

.. replacement:: authsource-param-code-block
.. replacement:: authsource-param-code-block

.. code-block:: java
:copyable: false
.. code-block:: java
:copyable: false

MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<hostname>:<port>/?authSource=users");
MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<hostname>:<port>/?authSource=users");

.. replacement:: dns-resolution-anchor
.. replacement:: dns-resolution-anchor

.. _java-dns-resolution-error:
.. _java-dns-resolution-error:

.. replacement:: dns-error-message
.. replacement:: dns-error-message

.. code-block:: none
:copyable: false
.. code-block:: none
:copyable: false

com.mongodb.MongoSocketWriteException: Exception sending message
com.mongodb.MongoSocketWriteException: Exception sending message

.. replacement:: check-the-number-of-connections-anchor
.. replacement:: check-the-number-of-connections-anchor

.. _java-connection-num-connections:
.. _java-connection-num-connections:

.. replacement:: mongo-client-class
.. replacement:: mongo-client-class

``MongoClient``
``MongoClient``

.. replacement:: max-pool-size-param
.. replacement:: max-pool-size-param

``maxPoolSize``
``maxPoolSize``

.. replacement:: max-pool-size-default
.. replacement:: max-pool-size-default

``100``
``100``

.. replacement:: max-idle-time-param
.. replacement:: max-idle-time-param

``maxIdleTimeMS``
``maxIdleTimeMS``

.. replacement:: connection-pools-learn-more
.. replacement:: connection-pools-learn-more

To learn more about how connection pooling works in the driver, see
:ref:`java-faq-connection-pool` in the FAQ.
To learn more about how connection pooling works in the driver, see
:ref:`java-faq-connection-pool` in the FAQ.

.. replacement:: scram-failure-error
.. replacement:: scram-failure-error

.. code-block::
.. code-block::

Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:27017.
Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:27017.

.. replacement:: check-credentials-formatting-anchor
.. replacement:: check-credentials-formatting-anchor

.. _java-troubleshooting-connection-string-auth:
.. _java-troubleshooting-connection-string-auth:

.. _java-connection-certificate:

Expand Down
36 changes: 18 additions & 18 deletions source/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Version 5.0 Breaking Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- This driver version introduces the following changes to the ``ConnectionId`` class:

- The ``ConnectionId`` constructor now accepts a value of type ``long`` as its second
parameter instead of type ``int``. Similarly, the constructor now accepts a value of
type ``Long`` as its third parameter instead of type ``Integer``. Because this change breaks
Expand All @@ -80,7 +80,7 @@ Version 5.0 Breaking Changes
- The following record annotations from the
``org.bson.codecs.record.annotations`` package are replaced with
annotations of the same name from the ``org.bson.codecs.pojo.annotations`` package:

- ``BsonId``
- ``BsonProperty``
- ``BsonRepresentation``
Expand All @@ -106,8 +106,8 @@ Version 5.0 Breaking Changes
``VectorSearchOptions`` type, as shown in the following code:

.. code-block:: java
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));

VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));

.. _java-breaking-changes-v5.0-observables:

Expand All @@ -116,9 +116,9 @@ Version 5.0 Breaking Changes
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The
API also exposes ``org.mongodb.scala.Observable[Unit]`` instead of
``org.mongodb.scala.Observable[Void]``.
.. After the 5.0 Scala API docs are released, this line will be uncommented.
``org.mongodb.scala.Observable[Void]``.

.. After the 5.0 Scala API docs are released, this line will be uncommented.
For more information, see the `Observable trait documentation <https://mongodb.github.io/mongo-java-driver/5.0/apidocs/mongo-scala-driver/org/mongodb/scala/Observable.html>`__.

- This driver changes how ``ClusterSettings`` computes
Expand All @@ -132,20 +132,20 @@ Version 5.0 Breaking Changes

.. code-block:: java

ClusterSettings.builder()
.applyConnectionString(new ConnectionString("mongodb://127.0.0.1:27017/?replicaSet=replset"))
.build()
.getMode()
ClusterSettings.builder()
.applyConnectionString(new ConnectionString("mongodb://127.0.0.1:27017/?replicaSet=replset"))
.build()
.getMode()

.. code-block:: java

ClusterSettings.builder()
.hosts(Collections.singletonList(
new ServerAddress("127.0.0.1", 27017)
))
.requiredReplicaSetName("replset")
.build()
.getMode()
ClusterSettings.builder()
.hosts(Collections.singletonList(
new ServerAddress("127.0.0.1", 27017)
))
.requiredReplicaSetName("replset")
.build()
.getMode()

- This driver changes how ``BsonDecimal128`` values respond to method calls, by
responding in the same way as ``Decimal128`` values. In particular,
Expand Down