Skip to content

Commit ef9872a

Browse files
byTimorstam
authored andcommitted
CSHARP-2123 Change maxTimeMS set from double to int
1 parent 4a45914 commit ef9872a

18 files changed

+19
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ internal BsonDocument CreateCommand(SemanticVersion serverVersion)
160160
{ "explain", true },
161161
{ "pipeline", new BsonArray(_pipeline) },
162162
{ "allowDiskUse", () => _allowDiskUse.Value, _allowDiskUse.HasValue },
163-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
163+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
164164
{ "collation", () => _collation.ToBsonDocument(), _collation != null },
165165
{ "hint", () => _hint, _hint != null },
166166
{ "comment", () => _comment, _comment != null }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ internal BsonDocument CreateCommand(ConnectionDescription connectionDescription,
277277
{ "aggregate", _collectionNamespace.CollectionName },
278278
{ "pipeline", new BsonArray(_pipeline) },
279279
{ "allowDiskUse", () => _allowDiskUse.Value, _allowDiskUse.HasValue },
280-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
280+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
281281
{ "collation", () => _collation.ToBsonDocument(), _collation != null },
282282
{ "hint", () => _hint, _hint != null },
283283
{ "comment", () => _comment, _comment != null }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ internal BsonDocument CreateCommand(SemanticVersion serverVersion)
220220
{ "pipeline", new BsonArray(_pipeline) },
221221
{ "allowDiskUse", () => _allowDiskUse.Value, _allowDiskUse.HasValue },
222222
{ "bypassDocumentValidation", () => _bypassDocumentValidation.Value, _bypassDocumentValidation.HasValue && Feature.BypassDocumentValidation.IsSupported(serverVersion) },
223-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
223+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
224224
{ "collation", () => _collation.ToBsonDocument(), _collation != null },
225225
{ "writeConcern", () => _writeConcern.ToBsonDocument(), Feature.CommandsThatWriteAcceptWriteConcern.ShouldSendWriteConcern(serverVersion, _writeConcern) },
226226
{ "cursor", new BsonDocument(), serverVersion >= new SemanticVersion(3, 5, 0) },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private BsonDocument CreateGetMoreCommand()
157157
{ "getMore", _cursorId },
158158
{ "collection", _collectionNamespace.CollectionName },
159159
{ "batchSize", () => _batchSize.Value, _batchSize > 0 },
160-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue }
160+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue }
161161
};
162162

163163
return command;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ internal BsonDocument CreateCommand(ConnectionDescription connectionDescription,
172172
{ "limit", () => _limit.Value, _limit.HasValue },
173173
{ "skip", () => _skip.Value, _skip.HasValue },
174174
{ "hint", _hint, _hint != null },
175-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
175+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
176176
{ "collation", () => _collation.ToBsonDocument(), _collation != null }
177177
};
178178

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ internal BsonDocument CreateCommand(ConnectionDescription connectionDescription,
191191
{ "distinct", _collectionNamespace.CollectionName },
192192
{ "key", _fieldName },
193193
{ "query", _filter, _filter != null },
194-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
194+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
195195
{ "collation", () => _collation.ToBsonDocument(), _collation != null }
196196
};
197197

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ internal BsonDocument CreateCommand()
152152
{ "$eval", _function },
153153
{ "args", () => new BsonArray(_args), _args != null },
154154
{ "nolock", () => _noLock.Value, _noLock.HasValue },
155-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue }
155+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue }
156156
};
157157
}
158158

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ internal BsonDocument CreateCommand(ConnectionDescription connectionDescription,
434434
{ "singleBatch", () => _limit < 0 || _singleBatch.Value, _limit < 0 || _singleBatch.HasValue },
435435
{ "comment", _comment, _comment != null },
436436
{ "maxScan", () => _maxScan.Value, _maxScan.HasValue },
437-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
437+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
438438
{ "max", _max, _max != null },
439439
{ "min", _min, _min != null },
440440
{ "returnKey", () => _returnKey.Value, _returnKey.HasValue },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ internal override BsonDocument CreateCommand(SemanticVersion serverVersion, long
108108
{ "remove", true },
109109
{ "sort", _sort, _sort != null },
110110
{ "fields", _projection, _projection != null },
111-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
111+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
112112
{ "writeConcern", () => WriteConcern.ToBsonDocument(), WriteConcern != null && !WriteConcern.IsServerDefault && Feature.FindAndModifyWriteConcern.IsSupported(serverVersion) },
113113
{ "collation", () => Collation.ToBsonDocument(), Collation != null },
114114
{ "txnNumber", () => transactionNumber, transactionNumber.HasValue }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ internal override BsonDocument CreateCommand(SemanticVersion serverVersion, long
170170
{ "sort", _sort, _sort != null },
171171
{ "fields", _projection, _projection != null },
172172
{ "upsert", true, _isUpsert },
173-
{ "maxTimeMS", () => _maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
173+
{ "maxTimeMS", () => (int)_maxTime.Value.TotalMilliseconds, _maxTime.HasValue },
174174
{ "writeConcern", () => WriteConcern.ToBsonDocument(), WriteConcern != null && !WriteConcern.IsServerDefault && Feature.FindAndModifyWriteConcern.IsSupported(serverVersion) },
175175
{ "bypassDocumentValidation", () => _bypassDocumentValidation.Value, _bypassDocumentValidation.HasValue && Feature.BypassDocumentValidation.IsSupported(serverVersion) },
176176
{ "collation", () => Collation.ToBsonDocument(), Collation != null },

0 commit comments

Comments
 (0)