Class SystemVariables


  • public final class SystemVariables
    extends Object
    Defines helper fields for referencing system variables
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static dev.morphia.aggregation.expressions.impls.Expression CLUSTER_TIME
      A variable that returns the current timestamp value.
      static dev.morphia.aggregation.expressions.impls.Expression CURRENT
      References the start of the field path being processed in the aggregation pipeline stage.
      static dev.morphia.aggregation.expressions.impls.Expression DESCEND
      One of the allowed results of a $redact expression.
      static dev.morphia.aggregation.expressions.impls.Expression KEEP
      One of the allowed results of a $redact expression.
      static dev.morphia.aggregation.expressions.impls.Expression NOW
      A variable that returns the current datetime value.
      static dev.morphia.aggregation.expressions.impls.Expression PRUNE
      One of the allowed results of a $redact expression.
      static dev.morphia.aggregation.expressions.impls.Expression REMOVE
      A variable which evaluates to the missing value.
      static dev.morphia.aggregation.expressions.impls.Expression ROOT
      References the root document, i.e.
    • Field Detail

      • CLUSTER_TIME

        public static final dev.morphia.aggregation.expressions.impls.Expression CLUSTER_TIME
        A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters.

        CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline.

        MongoDB documentation
        Aggregration Expression: $$CLUSTER_TIME
      • CURRENT

        public static final dev.morphia.aggregation.expressions.impls.Expression CURRENT
        References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT.

        CURRENT is modifiable. However, since $ is equivalent to $$CURRENT., rebinding CURRENT changes the meaning of $ accesses.

        MongoDB documentation
        Aggregration Expression: $$CURRENT
      • DESCEND

        public static final dev.morphia.aggregation.expressions.impls.Expression DESCEND
        One of the allowed results of a $redact expression.
        MongoDB documentation
        Aggregration Expression: $$DESCEND
      • KEEP

        public static final dev.morphia.aggregation.expressions.impls.Expression KEEP
        One of the allowed results of a $redact expression.
        MongoDB documentation
        Aggregration Expression: $$KEEP
      • NOW

        public static final dev.morphia.aggregation.expressions.impls.Expression NOW
        A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline.
        MongoDB documentation
        Aggregration Expression: $$NOW
      • PRUNE

        public static final dev.morphia.aggregation.expressions.impls.Expression PRUNE
        One of the allowed results of a $redact expression.
        MongoDB documentation
        Aggregration Expression: $$PRUNE
      • REMOVE

        public static final dev.morphia.aggregation.expressions.impls.Expression REMOVE
        A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a $projection, a field set to the variable REMOVE is excluded from the output.

        For an example of its usage, see Conditionally Exclude Fields.

        MongoDB documentation
        Aggregration Expression: $$REMOVE
      • ROOT

        public static final dev.morphia.aggregation.expressions.impls.Expression ROOT
        References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage.
        MongoDB documentation
        Aggregration Expression: $$ROOT