Skip to content

$second

Returns the second from the input date.

Options

  • date (optional) Input date. Default random (0-59).

Example

{
    "someDate": "$dt",
    "second": { "$second": "${someDate}" }
}
{
    "someDate": ISODate("2016-06-28T15:28:54.721Z"),
    "second": 54
}