@@ -275,9 +275,10 @@ where
275275 options : impl Into < Option < CountOptions > > ,
276276 session : impl Into < Option < & mut ClientSession > > ,
277277 ) -> 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) ;
281282 self . client ( ) . execute_operation ( op, session) . await
282283 }
283284
@@ -430,7 +431,10 @@ where
430431 filter : impl Into < Option < Document > > ,
431432 options : impl Into < Option < FindOptions > > ,
432433 ) -> 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) ;
434438 let client = self . client ( ) ;
435439
436440 client
@@ -461,10 +465,10 @@ where
461465 filter : impl Into < Option < Document > > ,
462466 options : impl Into < Option < FindOneOptions > > ,
463467 ) -> 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) ;
468472 let mut cursor = self . find ( filter, Some ( options) ) . await ?;
469473 cursor. next ( ) . await . transpose ( )
470474 }
@@ -477,10 +481,10 @@ where
477481 options : impl Into < Option < FindOneOptions > > ,
478482 session : & mut ClientSession ,
479483 ) -> 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) ;
484488 let mut cursor = self
485489 . find_with_session ( filter, Some ( options) , session)
486490 . await ?;
0 commit comments