Module spring.data.mongodb
Class DateOperators
java.lang.Object
org.springframework.data.mongodb.core.aggregation.DateOperators
Gateway to Date aggregation operations.
- Since:
- 1.10
- Author:
- Christoph Strobl, Matt Morrissette
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic interfaceDateOperators.DateParts<T extends DateOperators.DateParts<T>>static classstatic classstatic classAggregationExpressionfor$dateToString.static classstatic classAggregationExpressionfor$dayOfMonth.static classAggregationExpressionfor$dayOfWeek.static classAggregationExpressionfor$dayOfYear.static classAggregationExpressionfor$hour.static classstatic classAggregationExpressionfor$isoDayOfWeek.static classAggregationExpressionfor$isoWeek.static classAggregationExpressionfor$isoWeekYear.static classAggregationExpressionfor$millisecond.static classAggregationExpressionfor$minute.static classAggregationExpressionfor$month.static classAggregationExpressionfor$second.static interfaceInterface defining a temporal unit for date operators.static classTimezone represents a MongoDB timezone abstraction which can be represented with a timezone ID or offset as aString.static classAggregationExpressioncapable of setting a givenDateOperators.Timezone.static classAggregationExpressionfor$tsIncrement.static classAggregationExpressionfor$tsSecond.static classAggregationExpressionfor$week.static classAggregationExpressionfor$year. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConstruct a Date object by providing the date’s constituent properties.
NOTE: Requires MongoDB 3.6 or later.static DateOperators.DateFromStringdateFromString(String value) Construct a Date object from the given dateString.
To use afield referenceorAggregationExpressionas source of the date string considerDateOperators.DateOperatorFactory.fromString()orDateOperators.DateFromString.fromStringOf(AggregationExpression).
NOTE: Requires MongoDB 3.6 or later.Take the date referenced by given fieldReference.dateOf(AggregationExpression expression) Take the date resulting from the givenAggregationExpression.Take the given value as date.zonedDateOf(String fieldReference, DateOperators.Timezone timezone) Take the date referenced by given fieldReference.zonedDateOf(AggregationExpression expression, DateOperators.Timezone timezone) Take the date resulting from the givenAggregationExpression.
-
Constructor Details
-
DateOperators
public DateOperators()
-
-
Method Details
-
dateOf
Take the date referenced by given fieldReference.- Parameters:
fieldReference- must not be null.- Returns:
- new instance of
DateOperators.DateOperatorFactory.
-
zonedDateOf
public static DateOperators.DateOperatorFactory zonedDateOf(String fieldReference, DateOperators.Timezone timezone) Take the date referenced by given fieldReference.- Parameters:
fieldReference- must not be null.- Returns:
- new instance of
DateOperators.DateOperatorFactory. - Since:
- 3.3
-
dateOf
Take the date resulting from the givenAggregationExpression.- Parameters:
expression- must not be null.- Returns:
- new instance of
DateOperators.DateOperatorFactory.
-
zonedDateOf
public static DateOperators.DateOperatorFactory zonedDateOf(AggregationExpression expression, DateOperators.Timezone timezone) Take the date resulting from the givenAggregationExpression.- Parameters:
expression- must not be null.- Returns:
- new instance of
DateOperators.DateOperatorFactory. - Since:
- 3.3
-
dateValue
Take the given value as date.
This can be one of:- Parameters:
value- must not be null.- Returns:
- new instance of
DateOperators.DateOperatorFactory. - Since:
- 2.1
-
dateFromParts
Construct a Date object by providing the date’s constituent properties.
NOTE: Requires MongoDB 3.6 or later.- Returns:
- new instance of
DateOperators.DateFromPartsOperatorFactory. - Since:
- 2.1
-
dateFromString
Construct a Date object from the given dateString.
To use afield referenceorAggregationExpressionas source of the date string considerDateOperators.DateOperatorFactory.fromString()orDateOperators.DateFromString.fromStringOf(AggregationExpression).
NOTE: Requires MongoDB 3.6 or later.- Returns:
- new instance of
DateOperators.DateFromPartsOperatorFactory. - Since:
- 2.1
-