Add docs for addFieldFilter() function
Signed-off-by: David Arendsen <darendsen@gamepoint.com>
This commit is contained in:
parent
ea21f35c9c
commit
7eaee45b43
4 changed files with 54 additions and 10 deletions
|
|
@ -9,6 +9,7 @@ or [fromBucket()](functions/fromBucket.md)
|
||||||
* [fromMeasurement()](functions/fromMeasurement.md)
|
* [fromMeasurement()](functions/fromMeasurement.md)
|
||||||
* [addAggregateWindow()](functions/addAggregateWindow.md)
|
* [addAggregateWindow()](functions/addAggregateWindow.md)
|
||||||
* [addDuplicate()](functions/addDuplicate.md)
|
* [addDuplicate()](functions/addDuplicate.md)
|
||||||
|
* [addFieldFilter()](functions/addFieldFilter.md)
|
||||||
* [addGroup()](functions/addGroup.md)
|
* [addGroup()](functions/addGroup.md)
|
||||||
* [addLimit()](functions/addLimit.md)
|
* [addLimit()](functions/addLimit.md)
|
||||||
* [addMean()](functions/addMean.md)
|
* [addMean()](functions/addMean.md)
|
||||||
|
|
|
||||||
43
docs/functions/addFieldFilter.md
Normal file
43
docs/functions/addFieldFilter.md
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
# Flux Query Builder Docs
|
||||||
|
|
||||||
|
## Functions » 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/)
|
||||||
|
|
@ -38,12 +38,12 @@ use Arendsen\FluxQueryBuilder\Type\MathType;
|
||||||
|
|
||||||
```php
|
```php
|
||||||
->addReduce([
|
->addReduce([
|
||||||
[
|
[
|
||||||
'count' => new MathType('accumulator.count + 1'),
|
'count' => new MathType('accumulator.count + 1'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'count' => 0,
|
'count' => 0,
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
```php
|
```php
|
||||||
->from([
|
->from([
|
||||||
'bucket' => 'test_bucket',
|
'bucket' => 'test_bucket',
|
||||||
'host' => 'https://us-west-2-1.aws.cloud2.influxdata.com',
|
'host' => 'https://us-west-2-1.aws.cloud2.influxdata.com',
|
||||||
'org' => 'example-org',
|
'org' => 'example-org',
|
||||||
'token' => 'token'
|
'token' => 'token'
|
||||||
])
|
])
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue