Skip to content

Commit 43ea9c2

Browse files
committed
Added missing check.
1 parent 879f6c5 commit 43ea9c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MongoDB.Driver/Core/Operations/AggregateToCollectionOperation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public BsonDocument CreateCommand(OperationContext operationContext, ICoreSessio
204204
{ "pipeline", new BsonArray(_pipeline) },
205205
{ "allowDiskUse", () => _allowDiskUse.Value, _allowDiskUse.HasValue },
206206
{ "bypassDocumentValidation", () => _bypassDocumentValidation.Value, _bypassDocumentValidation.HasValue },
207-
{ "maxTimeMS", () => MaxTimeHelper.ToMaxTimeMS(_maxTime.Value), _maxTime.HasValue },
207+
{ "maxTimeMS", () => MaxTimeHelper.ToMaxTimeMS(_maxTime.Value), _maxTime.HasValue && !operationContext.IsRootContextTimeoutConfigured() },
208208
{ "collation", () => _collation.ToBsonDocument(), _collation != null },
209209
{ "readConcern", readConcern, readConcern != null },
210210
{ "writeConcern", writeConcern, writeConcern != null },

0 commit comments

Comments
 (0)