Skip to content

Commit b6bf7ab

Browse files
committed
Fixing docs
1 parent 0d60922 commit b6bf7ab

File tree

10 files changed

+33
-41
lines changed

10 files changed

+33
-41
lines changed

driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public class AggregateFlow<T : Any>(private val wrapped: AggregatePublisher<T>)
225225
explain(R::class.java, verbosity)
226226

227227
/**
228-
* Explain the execution plan for this operation with the server's default verbosity level.
228+
* Explain the execution plan for this operation.
229229
*
230230
* @param timeoutMS the timeout in milliseconds for the explain operation.
231231
* @return the execution plan.
@@ -234,7 +234,7 @@ public class AggregateFlow<T : Any>(private val wrapped: AggregatePublisher<T>)
234234
public suspend inline fun <reified R : Any> explain(timeoutMS: Long): R = explain(R::class.java, timeoutMS)
235235

236236
/**
237-
* Explain the execution plan for this operation with the given verbosity level.
237+
* Explain the execution plan for this operation.
238238
*
239239
* @param verbosity the verbosity of the explanation.
240240
* @param timeoutMS the timeout in milliseconds for the explain operation.
@@ -245,7 +245,7 @@ public class AggregateFlow<T : Any>(private val wrapped: AggregatePublisher<T>)
245245
explain(R::class.java, verbosity, timeoutMS)
246246

247247
/**
248-
* Explain the execution plan for this operation with the server's default verbosity level.
248+
* Explain the execution plan for this operation.
249249
*
250250
* @param R the type of the document class.
251251
* @param resultClass the document class to decode into.
@@ -257,7 +257,7 @@ public class AggregateFlow<T : Any>(private val wrapped: AggregatePublisher<T>)
257257
wrapped.explain(resultClass, timeoutMS).awaitSingle()
258258

259259
/**
260-
* Explain the execution plan for this operation with the given verbosity level.
260+
* Explain the execution plan for this operation.
261261
*
262262
* @param R the type of the document class.
263263
* @param resultClass the document class to decode into.

driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/FindFlow.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public class FindFlow<T : Any>(private val wrapped: FindPublisher<T>) : Flow<T>
303303
explain(R::class.java, verbosity)
304304

305305
/**
306-
* Explain the execution plan for this operation with the given timeout duration.
306+
* Explain the execution plan for this operation.
307307
*
308308
* @param R the type of the document class.
309309
* @param timeoutMS the timeout in milliseconds for the explain operation.
@@ -313,7 +313,7 @@ public class FindFlow<T : Any>(private val wrapped: FindPublisher<T>) : Flow<T>
313313
public suspend inline fun <reified R : Any> explain(timeoutMS: Long): R = explain(R::class.java, timeoutMS)
314314

315315
/**
316-
* Explain the execution plan for this operation with the given verbosity level and timeout duration.
316+
* Explain the execution plan for this operation.
317317
*
318318
* @param verbosity the verbosity of the explanation.
319319
* @param timeoutMS the timeout in milliseconds for the explain operation.
@@ -324,7 +324,7 @@ public class FindFlow<T : Any>(private val wrapped: FindPublisher<T>) : Flow<T>
324324
explain(R::class.java, verbosity, timeoutMS)
325325

326326
/**
327-
* Explain the execution plan for this operation with the default verbosity level and the given timeout duration.
327+
* Explain the execution plan for this operation.
328328
*
329329
* @param R the type of the document class.
330330
* @param resultClass the document class to decode into.

driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public class AggregateIterable<T : Any>(private val wrapped: JAggregateIterable<
189189
public fun let(variables: Bson?): AggregateIterable<T> = apply { wrapped.let(variables) }
190190

191191
/**
192-
* Explain the execution plan for this operation with the server's default verbosity level
192+
* Explain the execution plan for this operation.
193193
*
194194
* @param timeoutMS the timeout in milliseconds for the explain operation
195195
* @return the execution plan
@@ -198,7 +198,7 @@ public class AggregateIterable<T : Any>(private val wrapped: JAggregateIterable<
198198
public fun explain(timeoutMS: Long): Document = wrapped.explain(timeoutMS)
199199

200200
/**
201-
* Explain the execution plan for this operation with the given verbosity level
201+
* Explain the execution plan for this operation.
202202
*
203203
* @param verbosity the verbosity of the explanation
204204
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -208,7 +208,7 @@ public class AggregateIterable<T : Any>(private val wrapped: JAggregateIterable<
208208
public fun explain(verbosity: ExplainVerbosity, timeoutMS: Long): Document = wrapped.explain(verbosity, timeoutMS)
209209

210210
/**
211-
* Explain the execution plan for this operation with the server's default verbosity level
211+
* Explain the execution plan for this operation.
212212
*
213213
* @param R the type of the document class
214214
* @param resultClass the result document type.
@@ -219,7 +219,7 @@ public class AggregateIterable<T : Any>(private val wrapped: JAggregateIterable<
219219
public fun <R : Any> explain(resultClass: Class<R>, timeoutMS: Long): R = wrapped.explain(resultClass, timeoutMS)
220220

221221
/**
222-
* Explain the execution plan for this operation with the given verbosity level
222+
* Explain the execution plan for this operation.
223223
*
224224
* @param R the type of the document class
225225
* @param resultClass the result document type.
@@ -232,7 +232,7 @@ public class AggregateIterable<T : Any>(private val wrapped: JAggregateIterable<
232232
wrapped.explain(resultClass, verbosity, timeoutMS)
233233

234234
/**
235-
* Explain the execution plan for this operation with the server's default verbosity level
235+
* Explain the execution plan for this operation.
236236
*
237237
* @param R the type of the document class
238238
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -242,7 +242,7 @@ public class AggregateIterable<T : Any>(private val wrapped: JAggregateIterable<
242242
public inline fun <reified R : Any> explain(timeoutMS: Long): R = explain(R::class.java, timeoutMS)
243243

244244
/**
245-
* Explain the execution plan for this operation with the given verbosity level
245+
* Explain the execution plan for this operation.
246246
*
247247
* @param R the type of the document class
248248
* @param verbosity the verbosity of the explanation

driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/FindIterable.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public class FindIterable<T : Any>(private val wrapped: JFindIterable<T>) : Mong
285285
if (verbosity == null) wrapped.explain(resultClass) else wrapped.explain(resultClass, verbosity)
286286

287287
/**
288-
* Explain the execution plan for this operation with the server's default verbosity level
288+
* Explain the execution plan for this operation.
289289
*
290290
* @param timeoutMS the timeout in milliseconds for the explain operation
291291
* @return the execution plan
@@ -294,7 +294,7 @@ public class FindIterable<T : Any>(private val wrapped: JFindIterable<T>) : Mong
294294
public fun explain(timeoutMS: Long): Document = wrapped.explain(timeoutMS)
295295

296296
/**
297-
* Explain the execution plan for this operation with the given verbosity level
297+
* Explain the execution plan for this operation.
298298
*
299299
* @param verbosity the verbosity of the explanation
300300
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -304,7 +304,7 @@ public class FindIterable<T : Any>(private val wrapped: JFindIterable<T>) : Mong
304304
public fun explain(verbosity: ExplainVerbosity, timeoutMS: Long): Document = wrapped.explain(verbosity, timeoutMS)
305305

306306
/**
307-
* Explain the execution plan for this operation with the server's default verbosity level
307+
* Explain the execution plan for this operation.
308308
*
309309
* @param R the type of the document class
310310
* @param resultClass the result document type.

driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public interface AggregatePublisher<TResult> extends Publisher<TResult> {
274274
<E> Publisher<E> explain(Class<E> explainResultClass, ExplainVerbosity verbosity);
275275

276276
/**
277-
* Explain the execution plan for this operation with the server's default verbosity level
277+
* Explain the execution plan for this operation.
278278
*
279279
* @param timeoutMS the timeout in milliseconds for the explain operation
280280
* @return the execution plan
@@ -285,7 +285,7 @@ public interface AggregatePublisher<TResult> extends Publisher<TResult> {
285285
Publisher<Document> explain(long timeoutMS);
286286

287287
/**
288-
* Explain the execution plan for this operation with the given verbosity level
288+
* Explain the execution plan for this operation.
289289
*
290290
* @param verbosity the verbosity of the explanation
291291
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -297,7 +297,7 @@ public interface AggregatePublisher<TResult> extends Publisher<TResult> {
297297
Publisher<Document> explain(ExplainVerbosity verbosity, long timeoutMS);
298298

299299
/**
300-
* Explain the execution plan for this operation with the server's default verbosity level
300+
* Explain the execution plan for this operation.
301301
*
302302
* @param <E> the type of the document class
303303
* @param explainResultClass the document class to decode into
@@ -310,7 +310,7 @@ public interface AggregatePublisher<TResult> extends Publisher<TResult> {
310310
<E> Publisher<E> explain(Class<E> explainResultClass, long timeoutMS);
311311

312312
/**
313-
* Explain the execution plan for this operation with the given verbosity level
313+
* Explain the execution plan for this operation.
314314
*
315315
* @param <E> the type of the document class
316316
* @param explainResultClass the document class to decode into

driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/FindPublisher.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public interface FindPublisher<TResult> extends Publisher<TResult> {
340340
<E> Publisher<E> explain(Class<E> explainResultClass, ExplainVerbosity verbosity);
341341

342342
/**
343-
* Explain the execution plan for this operation with the server's default verbosity level
343+
* Explain the execution plan for this operation.
344344
*
345345
* @param timeoutMS the timeout in milliseconds for the explain operation
346346
* @return the execution plan
@@ -351,7 +351,7 @@ public interface FindPublisher<TResult> extends Publisher<TResult> {
351351
Publisher<Document> explain(long timeoutMS);
352352

353353
/**
354-
* Explain the execution plan for this operation with the given verbosity level
354+
* Explain the execution plan for this operation.
355355
*
356356
* @param verbosity the verbosity of the explanation
357357
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -363,7 +363,7 @@ public interface FindPublisher<TResult> extends Publisher<TResult> {
363363
Publisher<Document> explain(ExplainVerbosity verbosity, long timeoutMS);
364364

365365
/**
366-
* Explain the execution plan for this operation with the server's default verbosity level
366+
* Explain the execution plan for this operation.
367367
*
368368
* @param <E> the type of the document class
369369
* @param explainResultClass the document class to decode into
@@ -376,7 +376,7 @@ public interface FindPublisher<TResult> extends Publisher<TResult> {
376376
<E> Publisher<E> explain(Class<E> explainResultClass, long timeoutMS);
377377

378378
/**
379-
* Explain the execution plan for this operation with the given verbosity level
379+
* Explain the execution plan for this operation.
380380
*
381381
* @param <E> the type of the document class
382382
* @param explainResultClass the document class to decode into

driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncAggregateIterable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import com.mongodb.client.AggregateIterable
2020
import com.mongodb.client.model.Collation
2121
import org.bson.conversions.Bson
2222
import org.bson.{ BsonValue, Document }
23-
import org.mongodb.scala.{ AggregateObservable, TimeoutMode }
2423
import org.mongodb.scala.bson.DefaultHelper.DefaultsTo
24+
import org.mongodb.scala.{ AggregateObservable, TimeoutMode }
2525

2626
import java.util.concurrent.TimeUnit
2727
import scala.concurrent.duration.Duration

driver-sync/src/main/com/mongodb/client/AggregateIterable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public interface AggregateIterable<TResult> extends MongoIterable<TResult> {
281281
<E> E explain(Class<E> explainResultClass, ExplainVerbosity verbosity);
282282

283283
/**
284-
* Explain the execution plan for this operation with the server's default verbosity level and specified timeoutMS
284+
* Explain the execution plan for this operation.
285285
*
286286
* @param timeoutMS the timeout in milliseconds for the explain operation
287287
* @return the execution plan
@@ -291,7 +291,7 @@ public interface AggregateIterable<TResult> extends MongoIterable<TResult> {
291291
Document explain(long timeoutMS);
292292

293293
/**
294-
* Explain the execution plan for this operation with the given verbosity level and specified timeoutMS
294+
* Explain the execution plan for this operation.
295295
*
296296
* @param verbosity the verbosity of the explanation
297297
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -302,7 +302,7 @@ public interface AggregateIterable<TResult> extends MongoIterable<TResult> {
302302
Document explain(ExplainVerbosity verbosity, long timeoutMS);
303303

304304
/**
305-
* Explain the execution plan for this operation with the server's default verbosity level and specified timeoutMS
305+
* Explain the execution plan for this operation.
306306
*
307307
* @param <E> the type of the document class
308308
* @param explainResultClass the document class to decode into
@@ -314,7 +314,7 @@ public interface AggregateIterable<TResult> extends MongoIterable<TResult> {
314314
<E> E explain(Class<E> explainResultClass, long timeoutMS);
315315

316316
/**
317-
* Explain the execution plan for this operation with the given verbosity level and specified timeoutMS
317+
* Explain the execution plan for this operation.
318318
*
319319
* @param <E> the type of the document class
320320
* @param explainResultClass the document class to decode into

driver-sync/src/main/com/mongodb/client/FindIterable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public interface FindIterable<TResult> extends MongoIterable<TResult> {
333333
<E> E explain(Class<E> explainResultClass, ExplainVerbosity verbosity);
334334

335335
/**
336-
* Explain the execution plan for this operation with the server's default verbosity level and specified timeoutMS
336+
* Explain the execution plan for this operation.
337337
*
338338
* @param timeoutMS the timeout in milliseconds for the explain operation
339339
* @return the execution plan
@@ -343,7 +343,7 @@ public interface FindIterable<TResult> extends MongoIterable<TResult> {
343343
Document explain(long timeoutMS);
344344

345345
/**
346-
* Explain the execution plan for this operation with the given verbosity level and specified timeoutMS
346+
* Explain the execution plan for this operation.
347347
*
348348
* @param verbosity the verbosity of the explanation
349349
* @param timeoutMS the timeout in milliseconds for the explain operation
@@ -354,7 +354,7 @@ public interface FindIterable<TResult> extends MongoIterable<TResult> {
354354
Document explain(ExplainVerbosity verbosity, long timeoutMS);
355355

356356
/**
357-
* Explain the execution plan for this operation with the server's default verbosity level and specified timeoutMS
357+
* Explain the execution plan for this operation.
358358
*
359359
* @param <E> the type of the document class
360360
* @param explainResultClass the document class to decode into
@@ -366,7 +366,7 @@ public interface FindIterable<TResult> extends MongoIterable<TResult> {
366366
<E> E explain(Class<E> explainResultClass, long timeoutMS);
367367

368368
/**
369-
* Explain the execution plan for this operation with the given verbosity level and specified timeoutMS
369+
* Explain the execution plan for this operation.
370370
*
371371
* @param <E> the type of the document class
372372
* @param explainResultClass the document class to decode into

driver-sync/src/test/functional/com/mongodb/client/AbstractExplainTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import com.mongodb.client.model.Filters;
2525
import com.mongodb.event.CommandStartedEvent;
2626
import com.mongodb.internal.connection.TestCommandListener;
27-
import com.mongodb.internal.diagnostics.logging.Logger;
28-
import com.mongodb.internal.diagnostics.logging.Loggers;
2927
import org.bson.BsonDocument;
3028
import org.bson.BsonInt32;
3129
import org.bson.Document;
@@ -46,7 +44,6 @@
4644
import static org.junit.Assume.assumeTrue;
4745

4846
public abstract class AbstractExplainTest {
49-
private static final Logger LOGGER = Loggers.getLogger(AbstractExplainTest.class.getSimpleName());
5047
private MongoClient client;
5148
private TestCommandListener commandListener;
5249

@@ -205,9 +202,6 @@ public void testExplainWithMaxTimeMS() {
205202
+ " }"
206203
+ "}"));
207204

208-
// Run an explained find with the query predicate { name: 'john doe' }
209-
// Add a $where clause with JavaScript sleep to introduce delay that exceeds timeout
210-
// Use a short timeout (50ms) with a longer sleep (100ms) to trigger timeout
211205
FindIterable<Document> findIterable = collection.find(
212206
Filters.and(
213207
Filters.eq("name", "john doe")
@@ -219,8 +213,6 @@ public void testExplainWithMaxTimeMS() {
219213
findIterable.explain(50L); // Use 50ms timeout to trigger timeout
220214
fail("Expected MongoOperationTimeoutException but explain completed successfully");
221215
} catch (MongoOperationTimeoutException e) {
222-
LOGGER.info("Reported error: ", e);
223-
224216
// This is expected - the operation should timeout
225217
assertTrue("Exception message should mention timeout",
226218
e.getMessage().toLowerCase().contains("operation exceeded the timeout limit") || e.getMessage().toLowerCase().contains("timeout"));

0 commit comments

Comments
 (0)