@@ -275,9 +275,10 @@ where
275
275
options : impl Into < Option < CountOptions > > ,
276
276
session : impl Into < Option < & mut ClientSession > > ,
277
277
) -> Result < i64 > {
278
- let options = options. into ( ) ;
279
- let filter = filter. into ( ) ;
280
- let op = CountDocuments :: new ( self . namespace ( ) , filter, options) ;
278
+ let mut options = options. into ( ) ;
279
+ resolve_options ! ( self , options, [ read_concern, selection_criteria] ) ;
280
+
281
+ let op = CountDocuments :: new ( self . namespace ( ) , filter. into ( ) , options) ;
281
282
self . client ( ) . execute_operation ( op, session) . await
282
283
}
283
284
@@ -430,7 +431,10 @@ where
430
431
filter : impl Into < Option < Document > > ,
431
432
options : impl Into < Option < FindOptions > > ,
432
433
) -> Result < Cursor < T > > {
433
- let find = Find :: new ( self . namespace ( ) , filter. into ( ) , options. into ( ) ) ;
434
+ let mut options = options. into ( ) ;
435
+ resolve_options ! ( self , options, [ read_concern, selection_criteria] ) ;
436
+
437
+ let find = Find :: new ( self . namespace ( ) , filter. into ( ) , options) ;
434
438
let client = self . client ( ) ;
435
439
436
440
client
@@ -461,10 +465,10 @@ where
461
465
filter : impl Into < Option < Document > > ,
462
466
options : impl Into < Option < FindOneOptions > > ,
463
467
) -> Result < Option < T > > {
464
- let options: FindOptions = options
465
- . into ( )
466
- . map ( Into :: into )
467
- . unwrap_or_else ( Default :: default) ;
468
+ let mut options = options. into ( ) ;
469
+ resolve_options ! ( self , options , [ read_concern , selection_criteria ] ) ;
470
+
471
+ let options : FindOptions = options . map ( Into :: into ) . unwrap_or_else ( Default :: default) ;
468
472
let mut cursor = self . find ( filter, Some ( options) ) . await ?;
469
473
cursor. next ( ) . await . transpose ( )
470
474
}
@@ -477,10 +481,10 @@ where
477
481
options : impl Into < Option < FindOneOptions > > ,
478
482
session : & mut ClientSession ,
479
483
) -> Result < Option < T > > {
480
- let options: FindOptions = options
481
- . into ( )
482
- . map ( Into :: into )
483
- . unwrap_or_else ( Default :: default) ;
484
+ let mut options = options. into ( ) ;
485
+ resolve_options ! ( self , options , [ read_concern , selection_criteria ] ) ;
486
+
487
+ let options : FindOptions = options . map ( Into :: into ) . unwrap_or_else ( Default :: default) ;
484
488
let mut cursor = self
485
489
. find_with_session ( filter, Some ( options) , session)
486
490
. await ?;
0 commit comments