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 FillOptionsReturnsFillOptionsthat represents server defaults.Creates a newFillOptionswith the specified option in situations when there is no builder method that better satisfies your needs.<TExpression>
FillOptionspartitionBy(TExpression expression) Creates a newFillOptionswith the specified partitioning.partitionByFields(Iterable<String> fields) Creates a newFillOptionswith the specified partitioning.default FillOptionspartitionByFields(String... fields) Creates a newFillOptionswith the specified partitioning.Creates a newFillOptionswith the specified sorting.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
partitionBy
Creates a newFillOptionswith the specified partitioning. OverridespartitionByFields(Iterable).- Type Parameters:
TExpression- The type of theexpressionexpression.- Parameters:
expression- The expression specifying how to partition the data. The syntax is the same as the syntax foridinAggregates.group(Object, List).- Returns:
- A new
FillOptions.
-
partitionByFields
Creates a newFillOptionswith 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 newFillOptionswith 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 newFillOptionswith the specified sorting.- Parameters:
sortBy- The sort specification, which may be constructed viaSorts.- Returns:
- A new
FillOptions.
-
option
Creates a newFillOptionswith 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 equivalentFillOptionsobjects, 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
ReturnsFillOptionsthat represents server defaults.- Returns:
FillOptionsthat represents server defaults.
-