docs(datain): add description for filter fn 'between_time_range'
This commit is contained in:
parent
4e4331c654
commit
e3a5c45b76
|
@ -158,6 +158,14 @@ let v3 = data["voltage"].split(",");
|
|||
|
||||
过滤功能可以设置过滤条件,满足条件的数据行 才会被写入目标表。过滤条件表达式的结果必须是 boolean 类型。在编写过滤条件前,必须确定 解析字段的类型,根据解析字段的类型,可以使用判断函数、比较操作符(`>`、`>=`、`<=`、`<`、`==`、`!=`)来判断。
|
||||
|
||||
对时间戳过滤,可以采用以下函数。其中 ts 为符合 rfc3339 日期时间格式化字符串的字段,t1 和 t2 为相对当前时间的秒数,时间范围为 now + t1 ~ now + t2.
|
||||
```
|
||||
between_time_range(ts, t1, t2)
|
||||
|
||||
// 如果时间范围为最近7点内的才能入库,则过滤条件为:
|
||||
between_time_range(ts, -604800, 0)
|
||||
```
|
||||
|
||||
#### 字段类型及转换
|
||||
|
||||
只有明确解析出的每个字段的类型,才能使用正确的语法做数据过滤。
|
||||
|
|
Loading…
Reference in New Issue