Skip to main content

$addMonths

The $addMonths operator adds a specified number of months to a date object.

Input

  • An array containing a date object and an integer number of months to add

Output

  • A new date object with the specified number of months added

Examples

Add Months to Date

Result: Date object representing April 15, 2023 at 10:30:00 UTC

Add Months to Field Value

Result: A new date with months_to_add added to the start_date field