Package dev.morphia.aggregation.stages
Class Fill
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.Fill
Populates null and missing field values within documents.
You can use $fill to populate missing data points:
- In a sequence based on surrounding values.
- With a fixed value.
- Since:
- 2.3
- Since server release
- 5.3
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Possible methods for defining fill strategies. -
Method Summary
Modifier and TypeMethodDescriptionfield
(String name, Fill.Method method) Specifies an object indicating how to fill missing values in the target field.Specifies an object indicating how to fill missing values in the target field.static Fill
fill()
Creates a new $fill stagepartitionBy
(Expression partitionBy) Specifies an array of fields as the compound key to group the documents.partitionByFields
(String... fields) Specifies an array of fields as the compound key to group the documents.Specifies the field or fields to sort the documents within each partition.
-
Method Details
-
fill
Creates a new $fill stage- Returns:
- the new stage
- MongoDB documentation
- Aggregration Pipeline Stage: $fill
- Since server release
- 5.3
-
field
Specifies an object indicating how to fill missing values in the target field.- Parameters:
name
- the field namevalue
- the value to fill with- Returns:
- this
-
field
Specifies an object indicating how to fill missing values in the target field.- Parameters:
name
- the field namemethod
- the method to use when filling in missing values- Returns:
- this
-
partitionBy
Specifies an array of fields as the compound key to group the documents.- Parameters:
partitionBy
- the partition expression- Returns:
- this
-
partitionByFields
Specifies an array of fields as the compound key to group the documents.- Parameters:
fields
- the fields- Returns:
- this
-
sortBy
Specifies the field or fields to sort the documents within each partition.- Parameters:
sorts
- the sorting values to apply- Returns:
- this
-