> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrics-man.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Addmonths

# \$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

```json theme={null}
{
  "$addMonths": [
    {
      "$toDate": ["2023-01-15T10:30:00Z"]
    },
    3
  ]
}
```

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

### Add Months to Field Value

```json theme={null}
{
  "$addMonths": [
    {
      "$input": "start_date"
    },
    {
      "$input": "months_to_add"
    }
  ]
}
```

Result: A new date with months\_to\_add added to the start\_date field
