Add docs for addDuplicate and addGroup functions

This commit is contained in:
David Arendsen 2022-12-30 15:25:11 +01:00
commit 7b15bb7ad5
3 changed files with 94 additions and 1 deletions

View file

@ -4,4 +4,5 @@
On this page you will find the methods you can use in the query builder. On this page you will find the methods you can use in the query builder.
* [addAggregateWindow()](functions/addAggregateWindow.md) * [addAggregateWindow()](functions/addAggregateWindow.md)
* [addDuplicate()](functions/addDuplicate.md)

View file

@ -0,0 +1,46 @@
# Flux Query Builder Docs
## Functions » addDuplicate()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>column</td>
<td>string</td>
<td>Column to duplicate.</td>
</tr>
<tr>
<td>as</td>
<td>string</td>
<td>Name to assign to the duplicate column.</td>
</tr>
</tbody>
</table>
### Example
```php
->addDuplicate('tag', 'tag_dup')
```
This will result in the following Flux function part:
```
|> duplicate(
column: "tag",
as: "tag_dup",
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/duplicate/)

View file

@ -0,0 +1,46 @@
# Flux Query Builder Docs
## Functions &raquo; addGroup()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>columns</td>
<td>array</td>
<td>List of columns to use in the grouping operation.</td>
</tr>
<tr>
<td>mode</td>
<td>string</td>
<td>Grouping mode. Default is 'by'.</td>
</tr>
</tbody>
</table>
### Example
```php
->addGroup(['foo', 'bar'], 'by')
```
This will result in the following Flux function part:
```
|> group(
columns: ["foo", "bar"],
mode: "by"
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/group/)