Root node
Description
The Root node takes two numbers as input and calculates the [second number]th root of the first number, e.g. 8 and 3 = the cube root of 8 (∛8) = 2
Usage
The Root node is a function, so it can be added to the segments of comparison nodes and other functions.
It can be:
-
added to these comparison nodes:
- Equals
- Greater than
- Less than
- Not Equals
-
compared against, and populated with, these nodes:
- Attribute (of Number type)
- Count
- Number
- Length
- all other Arithmetic nodes
Configuration
-
Swap - change the comparison node. If any segments hold values, they'll remain but the node types offered will be limited.
-
Delete - remove the node.
Example
Fetch all street lights with a column that's √64 metres
In full detail:
Fetch items of the Street Lights design where their Column Height attribute is equal to the square root of 64
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your Alloy database.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Root",
"children": [
{
"type": "Number",
"properties": {
"value": [64]
}
},
{
"type": "Number",
"properties": {
"value": [2]
}
}
]
}
]
}
]
}