Add
How to use the Add operator
The Add
operator allows you to perform an addition on two number values, e.g. 2 + 2 = 4.
Allowed Children
Arithmetic nodes, Primitive and Reference nodes of Number type
Requirements
Must have 2 children
Return Type
Number
Example: Basic structure
{
"type": "Add",
"properties": {},
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_justANumberAttribute"
}
},
{
"type": "Number",
"properties": {
"value": 3
}
}
]
}
Example: Simple Add query
Find items where the sum of two specified attribute values are equal to 10.
{
"type": "Query",
"properties": {
"dodiCode": "designs_exampleJobs",
"attributes": ["all"]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Add",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsConeCount"
}
},
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsSafetyLightsCount"
}
}
]
},
{
"type": "Number",
"value": ["10"]
}
]
}
]
}