- Reference >
- Operators >
- Aggregation Pipeline Operators >
- Date Aggregation Operators >
- $second (aggregation)
$second (aggregation)¶
On this page
Definition¶
-
$second
¶ Returns the second portion of a date as a number between 0 and 59, but can be 60 to account for leap seconds.
The
$second
expression has the following syntax:The argument can be any valid expression as long as it resolves to a date. For more information on expressions, see Expressions.