- 
    Type:
Improvement
 - 
    Resolution: Unresolved
 - 
    Priority:
Major - P3
 - 
    None
 - 
    Affects Version/s: 4.1.6
 - 
    Component/s: Aggregation Framework
 - 
    None
 
- 
        Query Optimization
 - 
        (copied to CRM)
 - 
        None
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
Adding some more granular options to influence the $sample behaviour to improve:
- Consistency in sample size (as a percentage vs a fixed size)
 - Sampling method (rnd cursor vs collscan)
 
For example:
db.example.aggregate([{
  $sample: {
    percent: 10,
    method: "cursor"
  }
}]);
- The parameter for "size" and "percent" would be exclusive options
 - The [optional] parameter for "method" would take a value of "cursor", "scan" or "auto", defaulting to auto (representing the current implementation
 
- is related to
 - 
                    
SERVER-45474 $sample doesn't support variables or expression operators
-         
 - Backlog
 
 -         
 - 
                    
SERVER-72518 Make 5% random-cursor $sample cutoff configurable
-         
 - Closed
 
 -