添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Package org.springframework.data.mongodb.core.aggregation

Class ConditionalOperators.Cond

java.lang.Object
org.springframework.data.mongodb.core.aggregation.ConditionalOperators.Cond
All Implemented Interfaces:
AggregationExpression , MongoExpression
Enclosing class:
ConditionalOperators
public static class ConditionalOperators.Cond extends Object implements AggregationExpression
Encapsulates the aggregation framework $cond operator. A ConditionalOperators.Cond allows nested conditions if-then[if-then-else]-else using Field , CriteriaDefinition , AggregationExpression or a custom condition. Replacement values can be either field references , expressions , values of simple MongoDB types or values that can be converted to a simple MongoDB type.
Author:
Mark Paluch, Christoph Strobl
See Also:
  • https://docs.mongodb.com/manual/reference/operator/aggregation/cond/
  • Get a builder that allows fluent creation of ConditionalOperators.Cond .
    org.bson.Document
    Turns the AggregationExpression into a Document within the given AggregationOperationContext .
    when ( String booleanField)
    Start creating new ConditionalOperators.Cond by providing the field reference used in if .
    when (org.bson.Document booleanExpression)
    Start creating new ConditionalOperators.Cond by providing the boolean expression used in if .
    Start creating new ConditionalOperators.Cond by providing the AggregationExpression used in if .
    Start creating new ConditionalOperators.Cond by providing the CriteriaDefinition used in if .

    Methods inherited from class java.lang. Object

    clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait

    Methods inherited from interface org.springframework.data.mongodb.core.aggregation. AggregationExpression

    toDocument

    toDocument

    public org.bson.Document toDocument ( AggregationOperationContext context)
    Description copied from interface: AggregationExpression
    Turns the AggregationExpression into a Document within the given AggregationOperationContext .
    Specified by:
    toDocument in interface AggregationExpression
    Parameters:
    context - must not be null.
    Returns:
    the MongoDB native ( Document ) form of the expression.

    newBuilder

    public static ConditionalOperators.Cond.WhenBuilder newBuilder ()
    Get a builder that allows fluent creation of ConditionalOperators.Cond .
    Returns:
    never null.
    public static ConditionalOperators.Cond.ThenBuilder when (org.bson.Document booleanExpression)
    Start creating new ConditionalOperators.Cond by providing the boolean expression used in if .
    Parameters:
    booleanExpression - must not be null.
    Returns:
    never null.
    Start creating new ConditionalOperators.Cond by providing the AggregationExpression used in if .
    Parameters:
    expression - expression that yields in a boolean result, must not be null.
    Returns:
    never null.
    public static ConditionalOperators.Cond.ThenBuilder when ( String booleanField)
    Start creating new ConditionalOperators.Cond by providing the field reference used in if .
    Parameters:
    booleanField - name of a field holding a boolean value, must not be null.
    Returns:
    never null.
    Start creating new ConditionalOperators.Cond by providing the CriteriaDefinition used in if .
    Parameters:
    criteria - criteria to evaluate, must not be null.
    Returns:
    the ConditionalOperators.Cond.ThenBuilder