-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.2.0
-
Component/s: Aggregation Framework
-
Query Optimization
-
Fully Compatible
Specifying this option would prevent any optimized random cursor implementation from the storage engine, and would always use a top-k random sort, with the random value used to sort being multiplied by the specified weight.
For example:
db.example.aggregate([{
$sample: {
size: 100,
weight: "$myWeightField"
}
}]);
- related to
-
SERVER-30405 add expression to generate a random number
- Closed