Class SetWindowFields


  • public class SetWindowFields
    extends Stage
    Performs operations on a specified span of documents in a collection, known as a window, and returns the results based on the chosen window operator.
    Since:
    2.3
    Since server release
    5.0
    • Constructor Detail

      • SetWindowFields

        protected SetWindowFields()
    • Method Detail

      • setWindowFields

        public static SetWindowFields setWindowFields()
        Performs operations on a specified span of documents in a collection, known as a window, and returns the results based on the chosen window operator.
        Returns:
        the new stage
        Since:
        2.3
        Since server release
        5.0
        MongoDB documentation
        Aggregration Expression: $setWindowFields
      • output

        public SetWindowFields output​(SetWindowFields.Output... outputs)
        Specifies the field(s) to append to the documents in the output returned by the $setWindowFields stage.
        Parameters:
        outputs - the output fields
        Returns:
        this
      • outputs

        @MorphiaInternal
        public SetWindowFields.Output[] outputs()
        Returns:
        the outputs
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • partition

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

        public SetWindowFields partitionBy​(dev.morphia.aggregation.expressions.impls.Expression partition)
        Defines the expression to use to partition the data.
        Parameters:
        partition - the expression
        Returns:
        this
      • sortBy

        public SetWindowFields sortBy​(Sort... sorts)
        Specifies the field(s) to sort the documents by in the partition.
        Parameters:
        sorts - the sort criteria
        Returns:
        this
      • sorts

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