mirror of
https://github.com/noodlapp/noodl-docs.git
synced 2026-01-11 14:52:54 +01:00
Initial commit
Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: Michael Cartner <32543275+michaelcartner@users.noreply.github.com>
This commit is contained in:
82
nodes/cloud-functions/cloud-data/aggregate-records.md
Normal file
82
nodes/cloud-functions/cloud-data/aggregate-records.md
Normal file
@@ -0,0 +1,82 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Aggregate Records
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Aggregate Records
|
||||
|
||||
This node is used to compute an aggregate over properties of records in the cloud database.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You create and give a name to an aggregate.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
Then for each aggregate name you created you choose the property to aggregate over and the type of aggregate.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##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](/nodes/data/cloud-data/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 |
|
||||
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | 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**. |
|
||||
| <span className="ndl-data">Filter</span> | This specifies the type of filter, you can choose from:<br/><br/>`Visual`: Specify your filter using the visual filter editor.<br/>`JavaScript`: Specify your filter using JavaScript (this is more flexible and you can create more dynamic queyries but it's also more complex) |
|
||||
| <span className="ndl-data">Query Parameters</span> | <##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##> |
|
||||
| <span className="ndl-data">Aggregates</span> | <##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 |
|
||||
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Property</span> | Select the property of the **Class** that this aggregate should use. |
|
||||
| <span className="ndl-data">Operation</span> | Pick the operation that the aggregate should use. See above for which operations are available for which types. |
|
||||
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal here to perform the aggregate.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This output contains the error message incase something when wrong when executing the aggregate.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent here if the aggregate was successful and the result is ready.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##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##> |
|
||||
|
||||
63
nodes/cloud-functions/request.md
Normal file
63
nodes/cloud-functions/request.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Request
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Request
|
||||
|
||||
The **Request** node is the starting point for **Cloud Functions**, it is where the logic flow is initiated when the function is called from the client. Each cloud function component can only have one **Request** node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
It's also where any input parameters to the **Cloud Function** is provided. To learn more about cloud functions take a look at the [guide](/docs/guides/cloud-logic/introduction).
|
||||
|
||||
You specify what parameters the cloud function accepts in the properties of the **Request** node. Here you can also specify if the user must be logged in on the client to call this function.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
By default the user must be logged in on the client, and if thats not the case the cloud function call will automatically fail with an error indication an invalid session.
|
||||
|
||||
However, if you check the **Allow Unauthenticated** property the function can be called without a valid user session on the client.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
If the cloud function accepts unauthenticated requests, you can tell if the call was authenticated (there was a valid user session on the client) with the two outputs **Authenticated** and **User Id**. This can be used to trigger two different flows.
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Allow Unauthenticated</span> | Specifies if a valid user session (the user is logged in) is required on the client for calling this function. |
|
||||
|
||||
### Parameters
|
||||
You can add parameters using the properties of this node. Parameters will show up when using the [Cloud Function](/nodes/data/cloud-data/cloud-function) node to call a cloud function from the client.
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Authenticated</span> | This output will be **true** if the client calling this cloud function had a valid user session, i.e. the user was logged in. |
|
||||
| <span className="ndl-data">User Id</span> | If the user was logged in when calling this function this output will be the **Id** of the user record. |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Received</span> | This signal is the starting point for the cloud function logic flow. The first actions you want performed in the cloud function should be connected to this input. |
|
||||
|
||||
|
||||
48
nodes/cloud-functions/response.md
Normal file
48
nodes/cloud-functions/response.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Response
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Response
|
||||
|
||||
The **Response** node is used to complete a cloud function and return the result to the client. There can be many **Response** nodes in a cloud function and they can either return a **Success** or **Failure** result.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The response is sent when a signal is received on the **Send** input. You can specify if it's a successful or failed result in the properties using the **Status** property.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
If the status is **Failure** you can provide an error message that will be returned to the calling [Cloud Function](/nodes/data/cloud-data/cloud-function) node.
|
||||
|
||||
If the status is **Success** you can provide a number of result parameters that will be returned to the calling client [Cloud Function](/nodes/data/cloud-data/cloud-function) as outputs.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Status</span> | Specifies if this is a successful or failed response, **Success** or **Failure** that will be sent to the calling client when the **Send** signal is received. |
|
||||
| <span className="ndl-data">Error Message</span> | If this **Response** node have a **Failure** status you can provide an error message using this property that will be sent back to the client and the calling **Cloud Function** node. |
|
||||
|
||||
### Parameters
|
||||
You can add parameters using the properties of this node, if the **Status** is set to **Success**. Parameters will show up when using the [Cloud Function](/nodes/data/cloud-data/cloud-function) node as outputs. When the **Send** signal is received on a **Response** node it will send back the result parameters which will be emitted on the outputs of the cloud function node that made the call.
|
||||
|
||||
Reference in New Issue
Block a user