add note for matching params to drop() function

pull/358/head
Kelly 2019-07-25 18:06:21 -07:00
parent 4a42a4cbc4
commit c6295402aa
1 changed files with 9 additions and 0 deletions

View File

@ -28,13 +28,19 @@ drop(fn: (column) => column =~ /usage*/)
## Parameters
{{% note %}}
Make sure `fn` parameter names match each specified parameter. To learn why, see [Match parameter names](/v2.0/reference/flux/language/data-model/#match-parameter-names).
{{% /note %}}
### columns
Columns to be removed from the table.
Cannot be used with `fn`.
_**Data type:** Array of strings_
### fn
A predicate function which takes a column name as a parameter (`column`) and returns
a boolean indicating whether or not the column should be removed from the table.
Cannot be used with `columns`.
@ -44,6 +50,7 @@ _**Data type:** Function_
## Examples
##### Drop a list of columns
```js
from(bucket: "example-bucket")
|> range(start: -5m)
@ -51,6 +58,7 @@ from(bucket: "example-bucket")
```
##### Drop columns matching a predicate
```js
from(bucket: "example-bucket")
|> range(start: -5m)
@ -60,4 +68,5 @@ from(bucket: "example-bucket")
<hr style="margin-top:4rem"/>
##### Related InfluxQL functions and statements:
[DROP MEASUREMENT](https://docs.influxdata.com/influxdb/latest/query_language/database_management/#delete-measurements-with-drop-measurement)