Skip to content

Commit 5a7d693

Browse files
authored
DOCSP-36852: cleanup fy2025q1 (#525)
* DOCSP-36852: cleanup fy2025q1 * vale * vale * fix indent * MW PR fixes 1 * vale
1 parent 5cfe429 commit 5a7d693

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+258
-253
lines changed

source/compatibility.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ The first column lists the driver version.
5555

5656
.. include:: /includes/language-compatibility-table-java.rst
5757

58-
For more information on how to read the compatibility tables, see our guide on
58+
For more information about how to read the compatibility tables, see our guide on
5959
:ref:`MongoDB Compatibility Tables. <about-driver-compatibility>`

source/connection-troubleshooting.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ Connection Troubleshooting
159159
Security Certificate Errors
160160
---------------------------
161161

162-
If you use Java version 8 or earlier, you might need to add a certificate to
163-
your trust store. You can either upgrade to a later version of the JDK or read
164-
the :atlas:`Security FAQ </reference/faq/security/#java-users>` instructions
165-
in the Atlas documentation for information on how to add the certificate.
162+
If you use Java version 8 or earlier, you might need to add a
163+
certificate to your trust store. You can either upgrade to a later
164+
version of the JDK or read the :atlas:`Security FAQ
165+
</reference/faq/security/#java-users>` instructions in the Atlas
166+
documentation for information on how to add the certificate.
166167

167168
.. _java-timeout-errors:
168169

source/faq.txt

+11-11
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ introduced in Java 9.
3232
Which type of ``MongoClient`` should I use?
3333
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3434

35-
New applications should generally use the
35+
New applications generally use the
3636
``com.mongodb.client.MongoClient`` interface, which supports:
3737

3838
- Configuration with ``MongoClientSettings`` and ``ConnectionString``. You can create instances of this interface via factory methods defined in the ``com.mongodb.client.MongoClients`` class.
3939
- CRUD API using ``MongoDatabase``, and from there, ``MongoCollection``
4040

41-
You should use the ``com.mongodb.MongoClient`` class if you require support for the legacy API, which supports:
41+
Use the ``com.mongodb.MongoClient`` class if you require support for the legacy API, which supports:
4242

4343
- Configuration with ``MongoClientOptions`` and ``MongoClientURI``
4444
- CRUD API using ``DB``, and from there, ``DBCollection``. You can access this API via the ``getDB()`` method.
@@ -65,7 +65,7 @@ tasks with the ``MongoClientSettings`` class:
6565
- :ref:`Add Listeners For Driver and Database Events <listener-mongo-client-settings-example>`
6666
- :ref:`Get the Default Codec Registry <get-default-codec-registry-example>`
6767

68-
For more information on the ``MongoClientSettings`` class, see the
68+
For more information about the ``MongoClientSettings`` class, see the
6969
`API Documentation for MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__.
7070

7171
.. _java-faq-connection-pool:
@@ -149,7 +149,7 @@ use as they are returned to the pool.
149149
How do I prevent the "java.lang.NoClassDefFoundError: com/mongodb/MongoClient" error?
150150
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151151

152-
You may encounter a ``java.lang.NoClassDefFoundError`` exception when your
152+
You might encounter a ``java.lang.NoClassDefFoundError`` exception when your
153153
Java runtime environment cannot locate a class file at runtime. When you
154154
attempt to run application code that uses the {+driver-long+}, you must include
155155
the appropriate driver JAR files on the classpath.
@@ -166,7 +166,7 @@ your classpath, check the following items in your environment:
166166
.. tip::
167167

168168
This error contains the package and class name, which can help you identify
169-
which driver JAR may be missing from your classpath. To locate the
169+
which driver JAR might be missing from your classpath. To locate the
170170
driver JAR that the error refers to, check each of the entries in the
171171
:ref:`API documentation <java-api-landing>`.
172172

@@ -241,7 +241,7 @@ To learn more about the available builders classes, see the :ref:`<java-builders
241241
How do I prevent the "IllegalStateException: state should be: open" error?
242242
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
243243

244-
You may encounter this exception if you call an operation on a ``MongoClient``
244+
You might encounter this exception if you call an operation on a ``MongoClient``
245245
instance that closed its connections to MongoDB. Once the ``close()`` method
246246
is called on the ``MongoClient``, any further operation calls on that instance
247247
throw this exception.
@@ -251,7 +251,7 @@ after any code that calls ``close()`` on it.
251251

252252
.. tip::
253253

254-
The code that closes the ``MongoClient`` instance may be difficult to
254+
The code that closes the ``MongoClient`` instance might be difficult to
255255
locate in certain cases. To locate potential sources of this exception,
256256
search for the following cases:
257257

@@ -346,7 +346,7 @@ For example, the following methods throws an exception during encoding:
346346
How do I fix: "org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class X."?
347347
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348348

349-
This exception means you need to register a codec for the class since
349+
This exception means you must register a codec for the class since
350350
there is none at the moment.
351351

352352
How do I specify the collection name for a particular POJO class? Is there an annotation?
@@ -405,14 +405,14 @@ Imagine we are connecting to a collection that contains only this document:
405405
:start-after: start current-api-example
406406
:end-before: end current-api-example
407407

408-
The output of the preceding code snippet should look like this:
408+
The output of the preceding code snippet resembles the following:
409409

410410
.. code-block:: json
411411
:copyable: false
412412

413413
{"_id": 1, "val": 1}
414414

415-
For more information on the legacy classes and methods used in the preceding example,
415+
For more information about the legacy classes and methods used in the preceding example,
416416
see the following API documentation pages:
417417

418418
- `MongoClient <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__
@@ -453,7 +453,7 @@ Here is an example showing how to use the legacy ``MongoClientOptions`` and
453453
:start-after: start current-api-mongoclientsettings-example
454454
:end-before: end current-api-mongoclientsettings-example
455455

456-
For more information on the legacy classes and methods used in the preceding example,
456+
For more information about the legacy classes and methods used in the preceding example,
457457
see the following API Documentation pages:
458458

459459
- `Legacy API documentation <{+api+}/apidocs/mongodb-driver-legacy/index.html>`__

source/fundamentals/aggregation-expression-operations.txt

+11-11
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ imports in your code:
4242
import static com.mongodb.client.model.mql.MqlValues.*;
4343
import static java.util.Arrays.asList;
4444

45-
To access document fields in an expression, you need to reference the
45+
To access document fields in an expression, you must reference the
4646
current document being processed by the aggregation pipeline. Use the
4747
``current()`` method to refer to this document. To access the value of a
4848
field, you must use the appropriately typed method, such as
@@ -168,7 +168,7 @@ expressions.
168168
it literally. For example, ``of("$x")`` represents the string value
169169
``"$x"``, rather than a field named ``x``.
170170

171-
Refer to any of the sections in :ref:`Operations <java-aggregation-expression-ops-section>` for examples using these methods.
171+
See any of the sections in :ref:`Operations <java-aggregation-expression-ops-section>` for examples using these methods.
172172

173173
.. _java-aggregation-expression-ops-section:
174174

@@ -184,19 +184,19 @@ available in the driver and corresponding expression operators in the
184184
Query API. The method names link to API documentation and the
185185
aggregation pipeline operator names link to descriptions and examples in
186186
the Server manual documentation. While each Java method is effectively
187-
equivalent to the corresponding Query API expression, they may differ in
187+
equivalent to the corresponding Query API expression, they might differ in
188188
expected parameters and implementation.
189189

190190
.. note::
191191

192-
The driver generates a Query API expression that may be different
192+
The driver generates a Query API expression that might be different
193193
from the Query API expression provided in each example. However,
194194
both expressions will produce the same aggregation result.
195195

196196
.. important::
197197

198198
The driver does not provide methods for all aggregation pipeline operators in
199-
the Query API. If you need to use an unsupported operation in an
199+
the Query API. If you must use an unsupported operation in an
200200
aggregation, you must define the entire expression using the BSON ``Document``
201201
type. To learn more about the ``Document`` type, see :ref:`<fundamentals-documents>`.
202202

@@ -389,7 +389,7 @@ with ``lt()``. The ``project()`` method stores these filtered results as a new
389389
.. tip::
390390

391391
You must specify the type of the array that you retrieve with the
392-
``getArray()`` method if you need to work with the values of the
392+
``getArray()`` method if you work with the values of the
393393
array as their specific type.
394394

395395
In this example, we specify that the ``seats`` array contains values
@@ -670,7 +670,7 @@ into custom static methods.
670670

671671
- *No corresponding operator*
672672

673-
Suppose you need to determine how a class is performing against some
673+
Suppose you want to determine how a class is performing against some
674674
benchmarks. You want to find the average final grade for each class and
675675
compare it against the benchmark values.
676676

@@ -702,10 +702,10 @@ how the values compare:
702702
.. tip::
703703

704704
One advantage of using the ``passTo()`` method is that you can reuse
705-
your custom methods for other aggregations. You could
705+
your custom methods for other aggregations. You can
706706
use the ``gradeAverage()`` method to find the average of grades for
707707
groups of students filtered by, for example, entry year or district, not just their
708-
class. You could use the ``evaluate()`` method to evaluate, for
708+
class. You can use the ``evaluate()`` method to evaluate, for
709709
example, an individual student's performance, or an entire school's or
710710
district's performance.
711711

@@ -858,7 +858,7 @@ using the methods described in this section.
858858
* - `year() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#year(com.mongodb.client.model.mql.MqlString)>`__
859859
- :manual:`$year </reference/operator/aggregation/year/>`
860860

861-
Suppose you have data about package deliveries and need to match
861+
Suppose you have data about package deliveries and want to match
862862
deliveries that occurred on any Monday in the ``"America/New_York"`` time
863863
zone.
864864

@@ -1125,7 +1125,7 @@ using the methods described in this section.
11251125
* - `toUpper() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#toUpper()>`__
11261126
- :manual:`$toUpper </reference/operator/aggregation/toUpper/>`
11271127

1128-
Suppose you need to generate lowercase usernames for employees of a
1128+
Suppose you want to generate lowercase usernames for employees of a
11291129
company from the employees' last names and employee IDs.
11301130

11311131
The ``append()`` method combines the ``firstName`` and ``lastName`` fields into

source/fundamentals/aggregation.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Aggregation operations have some :manual:`limitations </core/aggregation-pipelin
6161
- Returned documents must not violate the :manual:`BSON document size limit </reference/limits/#mongodb-limit-BSON-Document-Size>`
6262
of 16 megabytes.
6363

64-
- Pipeline stages have a memory limit of 100 megabytes by default. If required, you may exceed this limit by using
64+
- Pipeline stages have a memory limit of 100 megabytes by default. If required, you can exceed this limit by using
6565
the `allowDiskUse <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html#allowDiskUse(java.lang.Boolean)>`__
6666
method.
6767

@@ -154,7 +154,7 @@ In the following example, the aggregation pipeline:
154154
:start-after: begin aggregation basic
155155
:end-before: end aggregation basic
156156

157-
The preceding aggregation should produce the following results:
157+
The preceding aggregation produces the following results:
158158

159159
.. code-block:: none
160160
:copyable: false
@@ -264,7 +264,7 @@ first element in the ``categories`` field.
264264
:start-after: begin aggregation expression
265265
:end-before: end aggregation expression
266266

267-
The preceding aggregation should produce the following results:
267+
The preceding aggregation produces the following results:
268268

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

source/fundamentals/auth.txt

+19-17
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Edition are as follows:
3434

3535
To authenticate using ``Kerberos`` or ``LDAP``, see the
3636
:doc:`Enterprise Authentication Mechanisms guide </fundamentals/enterprise-auth>`.
37-
For more information on establishing a connection to your MongoDB cluster,
37+
For more information about establishing a connection to your MongoDB cluster,
3838
read our :doc:`Connection Guide </fundamentals/connection>`.
3939

4040
Specify an Authentication Mechanism
@@ -90,8 +90,8 @@ mechanism:
9090
:tabid: Connection String
9191

9292
To specify the default authentication mechanism using a connection
93-
string, omit the mechanism. Your code to instantiate a ``MongoClient``
94-
should look something like this:
93+
string, omit the mechanism. The code to instantiate a ``MongoClient``
94+
resembles the following:
9595

9696
.. code-block:: java
9797

@@ -101,12 +101,12 @@ mechanism:
101101
:tabid: MongoCredential
102102

103103
To specify the default authentication mechanism using the
104-
``MongoCredential`` class, use the ``createCredential()`` method. Your
105-
code to instantiate a ``MongoClient`` should look something like this:
104+
``MongoCredential`` class, use the ``createCredential()`` method. The
105+
code to instantiate a ``MongoClient`` resembles the following:
106106

107107
.. include:: /includes/fundamentals/code-snippets/auth-credentials-default.rst
108108

109-
For more information on the challenge-response (CR) and salted
109+
For more information about the challenge-response (CR) and salted
110110
challenge-response authentication mechanisms (SCRAM) that MongoDB supports,
111111
see the :manual:`SCRAM </core/security-scram/>` section of the {+mdb-server+}
112112
manual.
@@ -152,8 +152,8 @@ mechanism:
152152

153153
To specify the ``SCRAM-SHA-256`` authentication mechanism using a
154154
connection string, assign the ``authMechanism`` parameter the value
155-
``SCRAM-SHA-256`` in your connection string. Your code to instantiate
156-
a ``MongoClient`` should look something like this:
155+
``SCRAM-SHA-256`` in your connection string. The code to instantiate
156+
a ``MongoClient`` resembles the following:
157157

158158
.. code-block:: java
159159

@@ -165,7 +165,8 @@ mechanism:
165165
To specify the default authentication mechanism using the
166166
``MongoCredential`` class, use the
167167
`createScramSha256Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createScramSha256Credential(java.lang.String,java.lang.String,char[])>`__
168-
method. Your code to instantiate a ``MongoClient`` should look something like this:
168+
method. The code to instantiate a ``MongoClient`` resembles
169+
the following:
169170

170171
.. include:: /includes/fundamentals/code-snippets/auth-credentials-sha256.rst
171172

@@ -209,8 +210,8 @@ mechanism:
209210

210211
To specify the ``SCRAM-SHA-1`` authentication mechanism using a
211212
connection string, assign the ``authMechanism`` parameter the value
212-
``SCRAM-SHA-1`` in your connection string. Your code to instantiate
213-
a ``MongoClient`` should look something like this:
213+
``SCRAM-SHA-1`` in your connection string. The code to instantiate
214+
a ``MongoClient`` resembles the following:
214215

215216
.. code-block:: java
216217

@@ -222,7 +223,7 @@ mechanism:
222223
To specify the default authentication mechanism using the
223224
``MongoCredential`` class, use the
224225
`createScramSha1Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createScramSha1Credential(java.lang.String,java.lang.String,char[])>`__
225-
method. Your code to instantiate a ``MongoClient`` should look something like this:
226+
method. The code to instantiate a ``MongoClient`` resembles the following:
226227

227228
.. include:: /includes/fundamentals/code-snippets/auth-credentials-sha1.rst
228229

@@ -463,7 +464,7 @@ for ``MONGODB-AWS`` authentication, use the `createAwsCredential() <{+api+}/api
463464
factory method.
464465

465466
You can supply only programmatic access keys to the
466-
``MongoCredential.createAwsCredential()`` method. If you need to supply ECS
467+
``MongoCredential.createAwsCredential()`` method. If you must supply ECS
467468
or EC2 container credentials, use the instructions in
468469
:ref:`<java-mongodb-aws-env-variables>` or :ref:`<java-mongodb-aws-sdk>`.
469470

@@ -485,7 +486,7 @@ in the following example:
485486
:end-before: end mongoCredential
486487
:emphasize-lines: 1
487488

488-
If you need to specify an AWS session token, pass it to the
489+
If you must specify an AWS session token, pass it to the
489490
`withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__
490491
method as shown in the following example:
491492

@@ -549,8 +550,8 @@ mechanism:
549550
To specify the ``X.509`` authentication mechanism using a connection
550551
string, assign the ``authMechanism`` parameter the value ``MONGODB-X509``
551552
and enable TLS by assigning the ``tls``
552-
parameter a ``true`` value. Your code to instantiate a ``MongoClient``
553-
should look something like this:
553+
parameter a ``true`` value. The code to instantiate a ``MongoClient``
554+
resembles the following:
554555

555556
.. code-block:: java
556557

@@ -566,7 +567,8 @@ mechanism:
566567
`applyToSslSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__
567568
method and setting the ``enabled`` property to ``true`` in the
568569
`SslSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/SslSettings.Builder.html>`__
569-
block. Your code to instantiate a ``MongoClient`` should look something like this:
570+
block. The code to instantiate a ``MongoClient`` resembles
571+
the following:
570572

571573
.. include:: /includes/fundamentals/code-snippets/auth-credentials-x509.rst
572574

source/fundamentals/builders/aggregates.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ discoverable, typesafe Java methods to use in your aggregations, see
3131

3232
.. tip::
3333

34-
For brevity, you may choose to import the methods of the following
34+
For brevity, you can choose to import the methods of the following
3535
classes statically to make your queries more succinct:
3636

3737
- ``Aggregates``
@@ -852,7 +852,7 @@ actions on these documents:
852852
- Group the documents by the ``position`` field.
853853

854854
The call to the ``densify()`` aggregation stage builder that accomplishes
855-
these actions should resemble the following:
855+
these actions resembles the following:
856856

857857
.. literalinclude:: /includes/fundamentals/code-snippets/builders/AggregateDensify.java
858858
:start-after: // begin densify aggregate

source/fundamentals/builders/filters.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type, which you can pass to any method that expects a query filter.
5555

5656
.. tip::
5757

58-
For brevity, you may choose to import all methods of the
58+
For brevity, you can choose to import all methods of the
5959
`Filters <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__
6060
class statically:
6161

source/fundamentals/builders/indexes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ instance, which you can pass to
3939

4040
.. tip::
4141

42-
For brevity, you may choose to import all methods of the
42+
For brevity, you can choose to import all methods of the
4343
`Indexes <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html>`__
4444
class statically:
4545

0 commit comments

Comments
 (0)