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 AggregationOperationContext
This toggle allows thecontext
to use any given field name without checking for its existence.default org.bson.codecs.configuration.CodecRegistry
Get the underlyingCodecRegistry
used by the MongoDB Java driver.default Fields
Returns theFields
exposed by the type.default org.bson.Document
getMappedObject
(org.bson.Document document) Returns the mappedDocument
, potentially converting the source considering mapping metadata etc.org.bson.Document
getMappedObject
(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.FieldReference
for the field with the given name.getReference
(Field field) Returns aExposedFields.FieldReference
for 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.FieldReference
for the given field.- Parameters:
field
- must not be null.- Returns:
- the
ExposedFields.FieldReference
for the givenField
. - Throws:
IllegalArgumentException
- if the context does not expose a field with the given name
-
getReference
Returns theExposedFields.FieldReference
for the field with the given name.- Parameters:
name
- must not be null or empty.- Returns:
- the
ExposedFields.FieldReference
for the field with given name. - Throws:
IllegalArgumentException
- if the context does not expose a field with the given name
-
getFields
Returns theFields
exposed by the type. May be a class or an interface. The default implementation usesproperty descriptors
discover fields from aClass
.- Parameters:
type
- must not be null.- Returns:
- never null.
- Since:
- 2.2
- See Also:
-
continueOnMissingFieldReference
This toggle allows thecontext
to use any given field name without checking for its existence. Typically theAggregationOperationContext
fails 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:CodecRegistryProvider
Get the underlyingCodecRegistry
used by the MongoDB Java driver.- Specified by:
getCodecRegistry
in interfaceCodecRegistryProvider
- Returns:
- never null.
-