Package com.mongodb.client.model.fill
Interface FillOptions
- All Superinterfaces:
Bson
Represents optional fields of the
$fill
pipeline stage of an aggregation pipeline.- 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 FillOptions
ReturnsFillOptions
that represents server defaults.Creates a newFillOptions
with the specified option in situations when there is no builder method that better satisfies your needs.<TExpression>
FillOptionspartitionBy
(TExpression expression) Creates a newFillOptions
with the specified partitioning.partitionByFields
(Iterable<String> fields) Creates a newFillOptions
with the specified partitioning.default FillOptions
partitionByFields
(String... fields) Creates a newFillOptions
with the specified partitioning.Creates a newFillOptions
with the specified sorting.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
partitionBy
Creates a newFillOptions
with the specified partitioning. OverridespartitionByFields(Iterable)
.- Type Parameters:
TExpression
- The type of theexpression
expression.- Parameters:
expression
- The expression specifying how to partition the data. The syntax is the same as the syntax forid
inAggregates.group(Object, List)
.- Returns:
- A new
FillOptions
.
-
partitionByFields
Creates a newFillOptions
with the specified partitioning. OverridespartitionBy(Object)
.- Parameters:
fields
- The fields to partition by.- Returns:
- A new
FillOptions
. - MongoDB documentation
- core/document/#dot-notation
-
partitionByFields
Creates a newFillOptions
with the specified partitioning. OverridespartitionBy(Object)
.- Parameters:
fields
- The fields to partition by.- Returns:
- A new
FillOptions
. - MongoDB documentation
- core/document/#dot-notation
-
sortBy
Creates a newFillOptions
with the specified sorting.- Parameters:
sortBy
- The sort specification, which may be constructed viaSorts
.- Returns:
- A new
FillOptions
.
-
option
Creates a newFillOptions
with the specified option 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 equivalentFillOptions
objects, though they may not be equal.FillOptions options1 = FillOptions.fillOptions().partitionByFields("fieldName"); FillOptions options2 = FillOptions.fillOptions().option("partitionByFields", Collections.singleton("fieldName"));
- Parameters:
name
- The option name.value
- The option value.- Returns:
- A new
FillOptions
.
-
fillOptions
ReturnsFillOptions
that represents server defaults.- Returns:
FillOptions
that represents server defaults.
-