Add docs for addFieldFilter() function

Signed-off-by: David Arendsen <darendsen@gamepoint.com>
This commit is contained in:
David Arendsen 2023-01-11 18:12:36 +01:00
commit 7eaee45b43
4 changed files with 54 additions and 10 deletions

View file

@ -0,0 +1,43 @@
# Flux Query Builder Docs
## Functions &raquo; addFieldFilter()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>fields</td>
<td>Yes</td>
<td>array</td>
<td>
The fields you want to have a filter on.
</td>
</tr>
</tbody>
</table>
### Example
```php
->addFieldFilter(['field1', 'field2'])
```
This will result in the following Flux function part:
```
|> filter(fn: (r) =>
r._field == "field1" or r._field == "field2"
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/filter/)

View file

@ -38,12 +38,12 @@ use Arendsen\FluxQueryBuilder\Type\MathType;
```php
->addReduce([
[
'count' => new MathType('accumulator.count + 1'),
],
[
'count' => 0,
]
[
'count' => new MathType('accumulator.count + 1'),
],
[
'count' => 0,
]
])
```

View file

@ -26,10 +26,10 @@
```php
->from([
'bucket' => 'test_bucket',
'host' => 'https://us-west-2-1.aws.cloud2.influxdata.com',
'org' => 'example-org',
'token' => 'token'
'bucket' => 'test_bucket',
'host' => 'https://us-west-2-1.aws.cloud2.influxdata.com',
'org' => 'example-org',
'token' => 'token'
])
```