- Reference >
- Operators >
- Aggregation Pipeline Operators >
- Date Aggregation Operators >
- $year (aggregation)
$year (aggregation)¶
On this page
Definition¶
-
$year¶ Returns the year portion of a date.
The
$yearexpression has the following syntax:The argument can be any expression as long as it resolves to a date. For more information on expressions, see Expressions.