Skip to main content

Power node

Description

The Power node takes two numbers as input and calculates the first to the power of the second, e.g. 9 and 2 = 9² = 81

Usage

The Power node is a function, so it can be added to the segments of comparison nodes and other functions.

alt text

It can be:

Configuration

alt text
  • 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 2³ metres

In full detail:

Fetch items of the Street Lights design where their Column Height attribute is equal to 2 to the power of 3

alt text
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": "Power",
"children": [
{
"type": "Number",
"properties": {
"value": [2]
}
},
{
"type": "Number",
"properties": {
"value": [3]
}
}
]
}
]
}
]
}