Skip to main content

$minute

The $minute operator extracts the minute component from a date object (0-59).

Input

  • A single date object

Output

  • The minute component of the date as an integer (0-59)

Examples

Extract Minute from Date

{
  "$minute": [
    {
      "$toDate": ["2023-01-15T10:30:00Z"]
    }
  ]
}
Result: 30

Extract Minute from Field

{
  "$minute": [
    {
      "$input": "event_date"
    }
  ]
}
Result: The minute component (0-59) of the event_date field