Class Sample
- java.lang.Object
-
- dev.morphia.aggregation.experimental.stages.Stage
-
- dev.morphia.aggregation.experimental.stages.Sample
-
public class Sample extends Stage
Randomly selects the specified number of documents from its input.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Sample(long size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
getSize()
static Sample
of(long size)
Deprecated, for removal: This API element is subject to removal in a future version.usesample(long)
static Sample
sample(long size)
Creates a new stage with the given sample size.-
Methods inherited from class dev.morphia.aggregation.experimental.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
of
@Deprecated(forRemoval=true) public static Sample of(long size)
Deprecated, for removal: This API element is subject to removal in a future version.usesample(long)
Creates a new stage with the given sample size.- Parameters:
size
- the sample size- Returns:
- the new stage
-
sample
public static Sample sample(long size)
Creates a new stage with the given sample size.- Parameters:
size
- the sample size- Returns:
- the new stage
- Since:
- 2.2
-
getSize
public long getSize()
- Returns:
- the size
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-