Add docs for addRange function

Signed-off-by: David Arendsen <darendsen@gamepoint.com>
This commit is contained in:
David Arendsen 2023-01-01 12:14:28 +01:00
commit 221238283a
2 changed files with 52 additions and 0 deletions

View file

@ -9,4 +9,5 @@ On this page you will find the methods you can use in the query builder.
* [addGroup()](functions/addGroup.md) * [addGroup()](functions/addGroup.md)
* [addLimit()](functions/addLimit.md) * [addLimit()](functions/addLimit.md)
* [addMean()](functions/addMean.md) * [addMean()](functions/addMean.md)
* [addRange()](functions/addRange.md)
* [addRawFunction()](functions/addRawFunction.md) * [addRawFunction()](functions/addRawFunction.md)

View file

@ -0,0 +1,51 @@
# Flux Query Builder Docs
## Functions &raquo; addRange()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Required</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>start</td>
<td>Yes</td>
<td>DateTime</td>
<td>Earliest time to include in results.</td>
</tr>
<tr>
<td>stop</td>
<td>No</td>
<td>DateTime</td>
<td>Latest time to include in results. Default is the current time.</td>
</tr>
</tbody>
</table>
### Example
```php
->addRange(
new DateTime('2022-08-12 18:00:00'),
new DateTime('2022-08-12 20:00:00')
)
```
This will result in the following Flux function part:
```
|> range(
start: time(v: 2022-08-12T18:00:00Z),
stop: time(v: 2022-08-12T20:00:00Z)
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/range/)