added note to map function about dropped columns, resolves #217

pull/219/head
Scott Anderson 2019-05-03 14:16:10 -06:00
parent 068ffa5f79
commit 90661c435b
1 changed files with 19 additions and 0 deletions

View File

@ -24,6 +24,25 @@ _**Output data type:** Object_
map(fn: (r) => r._value * r._value), mergeKey: true)
```
{{% note %}}
#### Dropped columns
`map()` drops any columns that:
1. Are not part of the input table's group key
2. Are not explicitly mapped in the `map()` function.
This often results in the `_time` column being dropped.
To preserve the `_time` column, include it in your column mapping.
```js
map(fn: (r) => ({
_time: r._time,
...
})
)
```
{{% /note %}}
## Parameters
### fn