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

@ -9,6 +9,7 @@ or [fromBucket()](functions/fromBucket.md)
* [fromMeasurement()](functions/fromMeasurement.md)
* [addAggregateWindow()](functions/addAggregateWindow.md)
* [addDuplicate()](functions/addDuplicate.md)
* [addFieldFilter()](functions/addFieldFilter.md)
* [addGroup()](functions/addGroup.md)
* [addLimit()](functions/addLimit.md)
* [addMean()](functions/addMean.md)

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/)