Class Fill


  • public class Fill
    extends Stage
    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
    • Constructor Detail

      • Fill

        protected Fill()
    • Method Detail

      • fill

        public static Fill fill()
        Creates a new $fill stage
        Returns:
        the new stage
      • field

        public Fill field​(String name,
                          dev.morphia.aggregation.expressions.impls.ValueExpression value)
        Specifies an object indicating how to fill missing values in the target field.
        Parameters:
        name - the field name
        value - the value to fill with
        Returns:
        this
      • field

        public Fill field​(String name,
                          Fill.Method method)
        Specifies an object indicating how to fill missing values in the target field.
        Parameters:
        name - the field name
        method - the method to use when filling in missing values
        Returns:
        this
      • fields

        @MorphiaInternal
        public Map<String,​Object> fields()
        Returns:
        this
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • partitionBy

        public Fill partitionBy​(dev.morphia.aggregation.expressions.impls.Expression partitionBy)
        Specifies an array of fields as the compound key to group the documents.
        Parameters:
        partitionBy - the partition expression
        Returns:
        this
      • partitionBy

        @Nullable
        @MorphiaInternal
        public dev.morphia.aggregation.expressions.impls.Expression partitionBy()
        Returns:
        this
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • partitionByFields

        public Fill partitionByFields​(String... fields)
        Specifies an array of fields as the compound key to group the documents.
        Parameters:
        fields - the fields
        Returns:
        this
      • partitionByFields

        @Nullable
        @MorphiaInternal
        public List<String> partitionByFields()
        Returns:
        this
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • sortBy

        public Fill sortBy​(Sort... sorts)
        Specifies the field or fields to sort the documents within each partition.
        Parameters:
        sorts - the sorting values to apply
        Returns:
        this
      • sortBy

        @Nullable
        @MorphiaInternal
        public Sort[] sortBy()
        Returns:
        this
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.