Skip to main content

Root

How to use the Root operator

The Root operator allows you to calculate the value of the root of a number.

Allowed Children

Arithmetic nodes, Primitive and Reference nodes of Number type

Requirements

Must have 2 children, the first child is the number to apply the nth root (the second child) to.

Return Type

Number

Example: Basic structure
{
"type": "Root",
"properties": {},
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_justANumberAttribute"
}
},
{
"type": "Number",
"properties": {
"value": 2
}
}
]
}
Example: Simple Root query

Find items where the result of one attribute rooted by another attribute value to equal to 1.

{
"type": "Query",
"properties": {
"dodiCode": "designs_exampleJobs",
"attributes": ["all"]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Root",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsConeCount"
}
},
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_jobsSafetyLightsCount"
}
}
]
},
{
"type": "Number",
"value": ["1"]
}
]
}
]
}