public class SampleOperation extends Object implements AggregationOperation
$sample
-operation.
We recommend to use the static factory method Aggregation.sample(long)
instead of creating instances of this
class directly.
Constructor and Description |
---|
SampleOperation(long sampleSize) |
Modifier and Type | Method and Description |
---|---|
org.bson.Document |
toDocument(AggregationOperationContext context)
|
public SampleOperation(long sampleSize)
sampleSize
- number of documents to be randomly selected from its input.public org.bson.Document toDocument(AggregationOperationContext context)
AggregationOperation
toDocument
in interface AggregationOperation
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.