Skip to content

Commit f941168

Browse files
committed
api docs + fixes
1 parent 5a7d56b commit f941168

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

source/connection/specify-connection-options/csot.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ timeout of 5 seconds by using each method:
6666
:language: java
6767
:start-after: start-string
6868
:end-before: end-string
69+
:dedent:
6970

7071
Behavior
7172
~~~~~~~~
@@ -75,7 +76,7 @@ accepted values for ``timeoutMS``:
7576

7677
.. list-table::
7778
:header-rows: 1
78-
:widths: 35 65
79+
:widths: 25 75
7980

8081
* - Value
8182
- Behavior
@@ -90,10 +91,10 @@ accepted values for ``timeoutMS``:
9091
- | Defers the timeout behavior to the following settings:
9192
|
9293
| - :manual:`waitQueueTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.waitQueueTimeoutMS>`
93-
| - :manual:`socketTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.socketTimeoutMS>`
94-
| - :manual:`wTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.wtimeoutMS>`
95-
| - :manual:`maxTimeMS </reference/method/cursor.maxTimeMS/>` *(deprecated)*
96-
| - `maxCommitTimeMS <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__ *(deprecated)*
94+
- :manual:`socketTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.socketTimeoutMS>`
95+
- :manual:`wTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.wtimeoutMS>`
96+
- :manual:`maxTimeMS </reference/method/cursor.maxTimeMS/>` *(deprecated)*
97+
- `maxCommitTimeMS <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__ *(deprecated)*
9798
|
9899
| When the CSOT feature is no longer experimental, all the
99100
preceding options will be deprecated.
@@ -159,9 +160,9 @@ Overrides
159160
The {+driver-short+} supports various levels of configuration to control the
160161
behavior and performance of database operations.
161162

162-
You can specify a ``timeoutMS`` option at the operation level to override the
163-
client-level configuration for a specific operation. This allows you to
164-
customize timeouts based on the needs of individual queries.
163+
You can specify a ``timeoutMS`` option at a lower level to override the
164+
client-level configuration. This allows you to customize timeouts based
165+
on the needs of individual operations.
165166

166167
The following example demonstrates how an collection-level timeout
167168
configuration can override a client-level timeout configuration:
@@ -292,4 +293,11 @@ API Documentation
292293
To learn more about using timeouts with the {+driver-short+}, see the following
293294
API documentation:
294295

295-
296+
- `MongoClientSettings <{+core-api+}/com/mongodb/MongoClientSettings.html>`__
297+
- `MongoClientSettings.Builder.timeout() <{+core-api+}/com/mongodb/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__
298+
- `MongoCollection.withTimeout() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withTimeout(long,java.util.concurrent.TimeUnit)>`__
299+
- `ClientSessionOptions.Builder.defaultTimeout() <{+core-api+}/com/mongodb/ClientSessionOptions.Builder.html#defaultTimeout(long,java.util.concurrent.TimeUnit)>`__
300+
- `TransactionOptions.Builder.timeout() <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#timeout(java.lang.Long,java.util.concurrent.TimeUnit)>`__
301+
- `ClientEncryptionSettings.Builder.timeout() <{+core-api+}/com/mongodb/ClientEncryptionSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__
302+
- `FindIterable.timeoutMode() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#timeoutMode(com.mongodb.client.cursor.TimeoutMode)>`__
303+
- `TimeoutMode <{+core-api+}/com/mongodb/client/cursor/TimeoutMode.html>`__

source/connection/specify-connection-options/stable-api.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
{+stable-api+}
66
==============
77

8-
9-
108
.. contents:: On this page
119
:local:
1210
:backlinks: none
@@ -145,4 +143,3 @@ API Documentation:
145143

146144
- `strict() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html#strict(boolean)>`__
147145
- `deprecationErrors() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html#>`__
148-

source/includes/connect/CSOT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ private void operationTimeout(){
5252
MongoDatabase database = mongoClient.getDatabase("db");
5353
MongoCollection<Document> collection = database.getCollection("people");
5454

55-
InsertOneResult result = collection.insertOne(new Document("name", "Francine Loews"));
56-
System.out.println("Inserted a document with ID: " + result.getInsertedId());
55+
collection.insertOne(new Document("name", "Francine Loews"));
5756
}
5857
// end-operation-timeout
5958
}

0 commit comments

Comments
 (0)