getRecord() 函数
getRecord()
从表中的指定索引提取一行作为记录。
如果指定的索引超出范围,该函数将返回错误。
函数类型签名
(<-table: stream[A], idx: int) => A where A: Record
有关更多信息,请参阅 函数类型签名。
参数
idx
(必需) 要提取的记录的索引。
table
输入表。 默认值为管道转发数据 (<-
)。
示例
从表中提取第一行作为记录
import "sampledata"
sampledata.int()
|> tableFind(fn: (key) => key.tag == "t1")
|> getRecord(idx: 0)// Returns {_time: 2021-01-01T00:00:00.000000000Z, _value: -2, tag: t1}
此页是否对您有帮助?
感谢您的反馈!