Class SetWindowFields

java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.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
  • Method Details

    • 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
      MongoDB documentation
      Aggregration Pipeline Stage: $setWindowFields
      Since server release
      5.0
    • 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
    • partitionBy

      public SetWindowFields partitionBy(Object 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