Package dev.morphia.aggregation.stages
Class Sample
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.Sample
Randomly selects the specified number of documents from its input.
-
Method Summary
-
Method Details
-
sample
Creates a new stage with the given sample size.- Parameters:
size
- the sample size- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $sample
- Since server release
- 3.2
-