Package com.mongodb.client.model.fill
Interface FillOutputField
- All Superinterfaces:
Bson
- All Known Subinterfaces:
LinearFillOutputField
,LocfFillOutputField
,ValueFillOutputField
The core part of the
$fill
pipeline stage of an aggregation pipeline.
A pair of an expression/method and a path to a field to be filled with evaluation results of the expression/method.- Since:
- 4.7
- See Also:
- Since server release
- 5.3
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY
-
Method Summary
Modifier and TypeMethodDescriptionstatic LinearFillOutputField
Returns aFillOutputField
that uses thelinear
method.static LocfFillOutputField
Returns aFillOutputField
that uses thelocf
method.static FillOutputField
Creates aFillOutputField
from aBson
in situations when there is no builder method that better satisfies your needs.static <TExpression>
ValueFillOutputFieldReturns aFillOutputField
that uses the specifiedexpression
.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
value
Returns aFillOutputField
that uses the specifiedexpression
.- Type Parameters:
TExpression
- Theexpression
type.- Parameters:
field
- The field to fill.expression
- The expression.- Returns:
- The requested
FillOutputField
. - MongoDB documentation
- Dot notation
-
locf
Returns aFillOutputField
that uses thelocf
method.- Parameters:
field
- The field to fill.- Returns:
- The requested
FillOutputField
. - MongoDB documentation
- Dot notation
-
linear
- Parameters:
field
- The field to fill.- Returns:
- The requested
FillOutputField
. - MongoDB documentation
- Dot notation
-
of
Creates aFillOutputField
from aBson
in situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.Example
The following code creates two functionally equivalentFillOutputField
s, though they may not be equal.FillOutputField field1 = FillOutputField.locf("fieldName"); FillOutputField field2 = FillOutputField.of(new Document("fieldName", new Document("method", "locf")));
- Parameters:
fill
- ABson
representing the requiredFillOutputField
.- Returns:
- The requested
FillOutputField
.
-