@@ -250,33 +250,24 @@ public BsonDocument CreateCommand(OperationContext operationContext, ICoreSessio
250
250
}
251
251
252
252
var isShardRouter = connectionDescription . HelloResult . ServerType == ServerType . ShardRouter ;
253
-
254
- var effectiveComment = _comment ;
255
- var effectiveHint = _hint ;
256
- var effectiveMax = _max ;
257
- var effectiveMin = _min ;
258
- var effectiveReturnKey = _returnKey ;
259
- var effectiveShowRecordId = _showRecordId ;
260
- var effectiveSort = _sort ;
261
-
262
253
var readConcern = ReadConcernHelper . GetReadConcernForCommand ( session , connectionDescription , _readConcern ) ;
263
254
return new BsonDocument
264
255
{
265
256
{ "find" , _collectionNamespace . CollectionName } ,
266
257
{ "filter" , _filter , _filter != null } ,
267
- { "sort" , effectiveSort , effectiveSort != null } ,
258
+ { "sort" , _sort , _sort != null } ,
268
259
{ "projection" , _projection , _projection != null } ,
269
- { "hint" , effectiveHint , effectiveHint != null } ,
260
+ { "hint" , _hint , _hint != null } ,
270
261
{ "skip" , ( ) => _skip . Value , _skip . HasValue } ,
271
262
{ "limit" , ( ) => Math . Abs ( _limit . Value ) , _limit . HasValue && _limit != 0 } ,
272
263
{ "batchSize" , ( ) => batchSize . Value , batchSize . HasValue && batchSize > 0 } ,
273
264
{ "singleBatch" , ( ) => _limit < 0 || _singleBatch . Value , _limit < 0 || _singleBatch . HasValue } ,
274
- { "comment" , effectiveComment , effectiveComment != null } ,
265
+ { "comment" , _comment , _comment != null } ,
275
266
{ "maxTimeMS" , ( ) => MaxTimeHelper . ToMaxTimeMS ( _maxTime . Value ) , _maxTime . HasValue && ! operationContext . IsRootContextTimeoutConfigured ( ) } ,
276
- { "max" , effectiveMax , effectiveMax != null } ,
277
- { "min" , effectiveMin , effectiveMin != null } ,
278
- { "returnKey" , ( ) => effectiveReturnKey . Value , effectiveReturnKey . HasValue } ,
279
- { "showRecordId" , ( ) => effectiveShowRecordId . Value , effectiveShowRecordId . HasValue } ,
267
+ { "max" , _max , _max != null } ,
268
+ { "min" , _min , _min != null } ,
269
+ { "returnKey" , ( ) => _returnKey . Value , _returnKey . HasValue } ,
270
+ { "showRecordId" , ( ) => _showRecordId . Value , _showRecordId . HasValue } ,
280
271
{ "tailable" , true , _cursorType == CursorType . Tailable || _cursorType == CursorType . TailableAwait } ,
281
272
{ "oplogReplay" , ( ) => _oplogReplay . Value , _oplogReplay . HasValue } ,
282
273
{ "noCursorTimeout" , ( ) => _noCursorTimeout . Value , _noCursorTimeout . HasValue } ,
0 commit comments