Interface AggregationOperationContext
- All Superinterfaces:
CodecRegistryProvider
- All Known Implementing Classes:
PrefixingDelegatingAggregationOperationContext,RelaxedTypeBasedAggregationOperationContext,TestAggregationContext,TypeBasedAggregationOperationContext
The context for an
AggregationOperation.- Since:
- 1.3
- Author:
- Oliver Gierke, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptiondefault AggregationOperationContextThis toggle allows thecontextto use any given field name without checking for its existence.default org.bson.codecs.configuration.CodecRegistryGet the underlyingCodecRegistryused by the MongoDB Java driver.default FieldsReturns theFieldsexposed by the type.default org.bson.DocumentgetMappedObject(org.bson.Document document) Returns the mappedDocument, potentially converting the source considering mapping metadata etc.org.bson.DocumentgetMappedObject(org.bson.Document document, Class<?> type) Returns the mappedDocument, potentially converting the source considering mapping metadata for the given type.getReference(String name) Returns theExposedFields.FieldReferencefor the field with the given name.getReference(Field field) Returns aExposedFields.FieldReferencefor the given field.Methods inherited from interface org.springframework.data.mongodb.CodecRegistryProvider
getCodecFor, hasCodecFor
-
Method Details
-
getMappedObject
default org.bson.Document getMappedObject(org.bson.Document document) Returns the mappedDocument, potentially converting the source considering mapping metadata etc.- Parameters:
document- will never be null.- Returns:
- must not be null.
-
getMappedObject
Returns the mappedDocument, potentially converting the source considering mapping metadata for the given type.- Parameters:
document- will never be null.type- can be null.- Returns:
- must not be null.
- Since:
- 2.2
-
getReference
Returns aExposedFields.FieldReferencefor the given field.- Parameters:
field- must not be null.- Returns:
- the
ExposedFields.FieldReferencefor the givenField. - Throws:
IllegalArgumentException- if the context does not expose a field with the given name
-
getReference
Returns theExposedFields.FieldReferencefor the field with the given name.- Parameters:
name- must not be null or empty.- Returns:
- the
ExposedFields.FieldReferencefor the field with given name. - Throws:
IllegalArgumentException- if the context does not expose a field with the given name
-
getFields
Returns theFieldsexposed by the type. May be a class or an interface. The default implementation usesproperty descriptorsdiscover fields from aClass.- Parameters:
type- must not be null.- Returns:
- never null.
- Since:
- 2.2
- See Also:
-
continueOnMissingFieldReference
This toggle allows thecontextto use any given field name without checking for its existence. Typically theAggregationOperationContextfails when referencing unknown fields, those that are not present in one of the previous stages or the input source, throughout the pipeline.- Returns:
- a more relaxed
AggregationOperationContext. - Since:
- 3.0
-
getCodecRegistry
default org.bson.codecs.configuration.CodecRegistry getCodecRegistry()Description copied from interface:CodecRegistryProviderGet the underlyingCodecRegistryused by the MongoDB Java driver.- Specified by:
getCodecRegistryin interfaceCodecRegistryProvider- Returns:
- never null.
-