Details
-
New Feature
-
Status: Backlog
-
Major - P3
-
Resolution: Unresolved
-
3.2.0
-
None
-
Query Optimization
-
Fully Compatible
Description
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" |
}
|
}]);
|
Attachments
Issue Links
- related to
-
SERVER-30405 add expression to generate a random number
-
- Closed
-