Add example for FnType usage
Signed-off-by: David Arendsen <darendsen@gamepoint.com>
This commit is contained in:
parent
ec73c70706
commit
348bc02fda
1 changed files with 23 additions and 0 deletions
|
|
@ -89,6 +89,29 @@ This will result in the following Flux function part:
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Advanced example
|
||||||
|
|
||||||
|
```php
|
||||||
|
use Arendsen\FluxQueryBuilder\Type\FnType;
|
||||||
|
|
||||||
|
->addAggregateWindow(
|
||||||
|
'20s',
|
||||||
|
FnType::params(['column', 'tables=<-'])
|
||||||
|
->withBody('tables')
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
This will result in the following Flux function part:
|
||||||
|
|
||||||
|
```
|
||||||
|
|> aggregateWindow(
|
||||||
|
column: "_value",
|
||||||
|
every: 20s,
|
||||||
|
fn: (column, tables=<-) => tables,
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Extra resources
|
### Extra resources
|
||||||
|
|
||||||
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/aggregatewindow/)
|
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/aggregatewindow/)
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue