public static class DateOperators.DateToString extends DateOperators.TimezonedDateAggregationExpression
AggregationExpression for $dateToString.| Modifier and Type | Class and Description |
|---|---|
static interface |
DateOperators.DateToString.FormatBuilder |
| Modifier and Type | Method and Description |
|---|---|
protected List<Object> |
append(Object value) |
protected Map<String,Object> |
append(String key,
Object value) |
protected Map<String,Object> |
argumentMap()
Get the argument map.
|
protected static List<Field> |
asFields(String... fieldRefs) |
protected boolean |
contains(Object key)
Check if the given key is available.
|
static DateOperators.DateToString.FormatBuilder |
dateOf(AggregationExpression expression)
Creates new
DateOperators.DateToString.FormatBuilder allowing to define the date format to apply. |
static DateOperators.DateToString.FormatBuilder |
dateOf(String fieldReference)
Creates new
DateOperators.DateToString.FormatBuilder allowing to define the date format to apply. |
static DateOperators.DateToString.FormatBuilder |
dateToString(Object value)
Creates new
DateOperators.DateToString.FormatBuilder. |
protected <T> T |
get(int index)
Get the value at a given index.
|
protected <T> T |
get(Object key)
Get the value for a given key.
|
protected String |
getMongoMethod() |
DateOperators.DateToString |
onNullReturn(Object value)
Optionally specify the value to return when the date is null or missing.
|
DateOperators.DateToString |
onNullReturnValueOf(AggregationExpression expression)
Optionally specify the expression to evaluate and return when the date is null or missing.
|
DateOperators.DateToString |
onNullReturnValueOf(String fieldReference)
Optionally specify the field holding the value to return when the date is null or missing.
|
org.bson.Document |
toDocument(AggregationOperationContext context)
|
org.bson.Document |
toDocument(Object value,
AggregationOperationContext context) |
protected List<Object> |
values() |
DateOperators.DateToString |
withTimezone(DateOperators.Timezone timezone)
Optionally set the
DateOperators.Timezone to use. |
appendTimezone, hasTimezonepublic static DateOperators.DateToString.FormatBuilder dateToString(Object value)
DateOperators.DateToString.FormatBuilder.value - must not be null and resolve to field, expression or object that represents a date.DateOperators.DateToString.FormatBuilder.IllegalArgumentException - if given value is null.public static DateOperators.DateToString.FormatBuilder dateOf(String fieldReference)
DateOperators.DateToString.FormatBuilder allowing to define the date format to apply.fieldReference - must not be null.public static DateOperators.DateToString.FormatBuilder dateOf(AggregationExpression expression)
DateOperators.DateToString.FormatBuilder allowing to define the date format to apply.expression - must not be null.public DateOperators.DateToString withTimezone(DateOperators.Timezone timezone)
DateOperators.Timezone to use. If not specified UTC is used.withTimezone in class DateOperators.TimezonedDateAggregationExpressiontimezone - must not be null. Consider DateOperators.Timezone.none() instead.DateOperators.Millisecond.IllegalArgumentException - if given timezone is null.public DateOperators.DateToString onNullReturn(Object value)
value - must not be null.DateOperators.DateToString.public DateOperators.DateToString onNullReturnValueOf(String fieldReference)
fieldReference - must not be null.DateOperators.DateToString.public DateOperators.DateToString onNullReturnValueOf(AggregationExpression expression)
expression - must not be null.DateOperators.DateToString.protected String getMongoMethod()
public org.bson.Document toDocument(AggregationOperationContext context)
AggregationExpressiontoDocument in interface AggregationExpressionpublic org.bson.Document toDocument(Object value, AggregationOperationContext context)
protected <T> T get(int index)
T - index - protected <T> T get(Object key)
T - key - protected boolean contains(Object key)
key - Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.