Class LookupOperation
java.lang.Object
org.springframework.data.mongodb.core.aggregation.LookupOperation
- All Implemented Interfaces:
AggregationOperation
,FieldsExposingAggregationOperation
,FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
public class LookupOperation
extends Object
implements FieldsExposingAggregationOperation, FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
Encapsulates the aggregation framework
$lookup
-operation. We recommend to use the builder provided via
newLookup()
instead of creating instances of this class directly.- Since:
- 1.9
- Author:
- Alessio Fachechi, Christoph Strobl, Mark Paluch, Sangyong Choi
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static final class
Builder for fluentLookupOperation
creation.static interface
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation
FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
-
Constructor Summary
ConstructorDescriptionLookupOperation
(String from, Field localField, Field foreignField, VariableOperators.Let let, AggregationPipeline pipeline, Field as) LookupOperation
(String from, VariableOperators.Let let, AggregationPipeline pipeline, Field as) LookupOperation
(Field from, Field localField, Field foreignField, Field as) Creates a newLookupOperation
for the givenField
s. -
Method Summary
Modifier and TypeMethodDescriptionReturns the fields exposed by theAggregationOperation
.Return the MongoDB operator that is used for thisAggregationOperation
.static LookupOperation.FromBuilder
Get a builder that allows creation ofLookupOperation
.org.bson.Document
toDocument
(AggregationOperationContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationOperation
toPipelineStages
Methods inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
inheritsFields
-
Constructor Details
-
LookupOperation
Creates a newLookupOperation
for the givenField
s.- Parameters:
from
- must not be null.localField
- must not be null.foreignField
- must not be null.as
- must not be null.
-
LookupOperation
public LookupOperation(String from, @Nullable VariableOperators.Let let, AggregationPipeline pipeline, Field as) - Parameters:
from
- must not be null.let
- must not be null.as
- must not be null.- Since:
- 4.1
-
LookupOperation
public LookupOperation(String from, @Nullable Field localField, @Nullable Field foreignField, @Nullable VariableOperators.Let let, @Nullable AggregationPipeline pipeline, Field as) - Parameters:
from
- must not be null.localField
- can be null if pipeline is present.foreignField
- can be null if pipeline is present.let
- can be null if localField and foreignField are present.as
- must not be null.- Since:
- 4.1
-
-
Method Details
-
getFields
Description copied from interface:FieldsExposingAggregationOperation
Returns the fields exposed by theAggregationOperation
.- Specified by:
getFields
in interfaceFieldsExposingAggregationOperation
- Returns:
- will never be null.
-
toDocument
Description copied from interface:AggregationOperation
- Specified by:
toDocument
in interfaceAggregationOperation
- Parameters:
context
- theAggregationOperationContext
to operate within. Must not be null.- Returns:
- the Document
-
getOperator
Description copied from interface:AggregationOperation
Return the MongoDB operator that is used for thisAggregationOperation
. Aggregation operations should implement this method to avoid document rendering.- Specified by:
getOperator
in interfaceAggregationOperation
- Returns:
- the operator used for this
AggregationOperation
.
-
newLookup
Get a builder that allows creation ofLookupOperation
.- Returns:
- never null.
-