public static class DateOperators.DateAdd extends DateOperators.TimezonedDateAggregationExpression
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractAggregationExpression.Expand
Expand a nested list of values to single entries or keep the list.
|
| Modifier and Type | Method and Description |
|---|---|
static DateOperators.DateAdd |
addValue(Object value,
String unit)
Add the number of units to a
start date. |
static DateOperators.DateAdd |
addValueOf(AggregationExpression expression,
String unit)
Add the number of units of the result of the given
expression to a
start date. |
static DateOperators.DateAdd |
addValueOf(String fieldReference,
String unit)
Add the number of units from a field to a
start date. |
protected List<Object> |
append(Object value) |
protected List<Object> |
append(Object value,
AbstractAggregationExpression.Expand expandList) |
protected Map<String,Object> |
append(String key,
Object value) |
protected Map<String,Object> |
appendAt(int index,
String key,
Object value)
Append the given key at the position in the underlying
LinkedHashMap. |
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.
|
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() |
protected Map<String,Object> |
remove(String key) |
DateOperators.DateAdd |
toDate(Object dateExpression)
Define the start date, in UTC, for the addition operation.
|
DateOperators.DateAdd |
toDateOf(AggregationExpression expression)
Define the start date, in UTC, for the addition operation.
|
DateOperators.DateAdd |
toDateOf(String fieldReference)
Define the start date, in UTC, for the addition operation.
|
org.bson.Document |
toDocument(AggregationOperationContext context)
|
org.bson.Document |
toDocument(Object value,
AggregationOperationContext context) |
protected List<Object> |
values() |
DateOperators.DateAdd |
withTimezone(DateOperators.Timezone timezone)
Optionally set the
DateOperators.Timezone to use. |
appendTimezone, hasTimezoneclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfrom, toDocumentcreate, createpublic static DateOperators.DateAdd addValueOf(AggregationExpression expression, String unit)
expression to a
start date.expression - must not be null.unit - must not be null.DateOperators.DateAdd.public static DateOperators.DateAdd addValueOf(String fieldReference, String unit)
start date.fieldReference - must not be null.unit - must not be null.DateOperators.DateAdd.public static DateOperators.DateAdd addValue(Object value, String unit)
start date.value - must not be null.unit - must not be null.DateOperators.DateAdd.public DateOperators.DateAdd toDateOf(AggregationExpression expression)
expression - must not be null.DateOperators.DateAdd.public DateOperators.DateAdd toDateOf(String fieldReference)
fieldReference - must not be null.DateOperators.DateAdd.public DateOperators.DateAdd toDate(Object dateExpression)
dateExpression - anything that evaluates to a valid date. Must not be null.DateOperators.DateAdd.public DateOperators.DateAdd 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.DateAdd.protected String getMongoMethod()
public org.bson.Document toDocument(AggregationOperationContext context)
AggregationExpressiontoDocument in interface AggregationExpressioncontext - must not be null.Document) form of the expression.public org.bson.Document toDocument(Object value, AggregationOperationContext context)
protected List<Object> append(Object value, AbstractAggregationExpression.Expand expandList)
protected Map<String,Object> appendAt(int index, String key, Object value)
LinkedHashMap.index - key - value - protected <T> T get(int index)
T - index - protected <T> T get(Object key)
T - key - protected boolean contains(Object key)
key - Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.