$add
The$add operator adds two numeric values together.
Input
- An array containing exactly two numeric values to add
Output
- The sum of the two input values
Examples
Basic Addition
8
Field Value Addition
Mixed Number Types
12.8Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
$add operator adds two numeric values together.
{
"$add": [
5,
3
]
}
8
{
"$add": [
{
"$input": "base_salary"
},
{
"$input": "bonus"
}
]
}
{
"$add": [
10.5,
2.3
]
}
12.8