Files
noodl-docs/nodes/cloud-functions/cloud-data/aggregate-records/README.md
Eric Tuvesson 656e5fc8d2 chore: Upgrade Docusaurus from v2 to v3 (#52)
* chore: Upgrade Docusaurus from v2 to v3

* chore: Update "Test build" GH workflow

* fix: build

All markdown is processed as MDX

* fix: Broken links
2024-01-12 16:53:22 +01:00

6.7 KiB

hide_title, hide_table_of_contents, title
hide_title hide_table_of_contents title
true true Aggregate Records node

{/##head##/}

Aggregate Records

This node is used to compute an aggregate over properties of records in the cloud database.

You create and give a name to an aggregate.

Then for each aggregate name you created you choose the property to aggregate over and the type of aggregate.

{/##head##/}

You can also specify filters to limit the aggretate to a select set of recrods. This is done in the same way as with the Query Records node, please see those reference docs for more details.

You can do aggregates over two types of properties String and Number, these are the available aggregates:

String, for string there is only one aggregate, Distinct this returns the unique values for the property in all records.

Number, for number you can use the following aggregates:

  • Min This will return the minumum value for the property for all records.
  • Max Return the maximum value for the property for all records.
  • Sum Return the sum of the property for all records.
  • Avg Return the avegage of the property for all records.

Inputs

Data Description
Class Select the Class for the types of records this node should do aggregate over. When the Class is selected you can create filters and aggregates of the Class.
Filter This specifies the type of filter, you can choose from:

Visual: Specify your filter using the visual filter editor.
JavaScript: Specify your filter using JavaScript (this is more flexible and you can create more dynamic queyries but it's also more complex)
Query Parameters {/##input:qp-*##/}The input for specifying the value of a query parameter.{/##input##/} Each paramteter used in your query will get an input where you can provide a value through a connection.{/##input##/}
Aggregates {/##input:aggregates##/}This a list of the aggregates you want to perform. You must provide the names of the outputs that will contain the aggregates here.{/##input##/}

Aggregate property and operation

For each aggregate you create you also need to provide the property if should aggregate and the operation it should use.

Data Description
Property Select the property of the Class that this aggregate should use.
Operation Pick the operation that the aggregate should use. See above for which operations are available for which types.
Signal Description
Do {/##input:do##/}Send a signal here to perform the aggregate.{/##input##/}

Outputs

Data Description
Error {/##output:error##/}This output contains the error message incase something when wrong when executing the aggregate.{/##output##/}
Signal Description
Success {/##output:success##/}A signal is sent here if the aggregate was successful and the result is ready.{/##output##/}
Failure {/##output:failure##/}A signal is sent here if something went wrong with the aggregate. You can find the error message via the Error output.{/##output##/}