public static class ConditionalOperators.Cond extends Object implements AggregationExpression
$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.| Modifier and Type | Class and Description |
|---|---|
static interface |
ConditionalOperators.Cond.OtherwiseBuilder |
static interface |
ConditionalOperators.Cond.ThenBuilder |
static interface |
ConditionalOperators.Cond.WhenBuilder |
| Modifier and Type | Method and Description |
|---|---|
static ConditionalOperators.Cond.WhenBuilder |
newBuilder()
Get a builder that allows fluent creation of
ConditionalOperators.Cond. |
org.bson.Document |
toDocument(AggregationOperationContext context)
|
static ConditionalOperators.Cond.ThenBuilder |
when(AggregationExpression expression)
|
static ConditionalOperators.Cond.ThenBuilder |
when(CriteriaDefinition criteria)
|
static ConditionalOperators.Cond.ThenBuilder |
when(org.bson.Document booleanExpression)
Start creating new
ConditionalOperators.Cond by providing the boolean expression used in if. |
static ConditionalOperators.Cond.ThenBuilder |
when(String booleanField)
Start creating new
ConditionalOperators.Cond by providing the field reference used in if. |
public org.bson.Document toDocument(AggregationOperationContext context)
AggregationExpressiontoDocument in interface AggregationExpressionpublic static ConditionalOperators.Cond.WhenBuilder newBuilder()
ConditionalOperators.Cond.public static ConditionalOperators.Cond.ThenBuilder when(org.bson.Document booleanExpression)
ConditionalOperators.Cond by providing the boolean expression used in if.booleanExpression - must not be null.public static ConditionalOperators.Cond.ThenBuilder when(AggregationExpression expression)
expression - expression that yields in a boolean result, must not be null.public static ConditionalOperators.Cond.ThenBuilder when(String booleanField)
ConditionalOperators.Cond by providing the field reference used in if.booleanField - name of a field holding a boolean value, must not be null.public static ConditionalOperators.Cond.ThenBuilder when(CriteriaDefinition criteria)
criteria - criteria to evaluate, must not be null.ConditionalOperators.Cond.ThenBuilderCopyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.