Documentation

boundaries.month() 函数

boundaries.month() 返回一个记录,包含当前月份的 start 和 stop 边界时间戳。

now() 确定当前月份。

函数类型签名
(?month_offset: int) => {stop: time, start: time}

有关更多信息,请参见 Function type signatures。

参数

月份偏移

从当前月份开始偏移的月份数。默认值是 0。

使用负偏移量返回先前月份的边界。使用正偏移量返回未来月份的边界。

示例

返回当前月份的开始和结束时间戳

import "date/boundaries"

option now = () => 2022-05-10T10:10:00Z

boundaries.month(

)// Returns {start:2022-05-01T00:00:00.000000000Z, stop:2022-06-01T00:00:00.000000000Z}

查询本月的数据

import "date/boundaries"

thisMonth = boundaries.month()

from(bucket: "example-bucket")
    |> range(start: thisMonth.start, stop: thisMonth.stop)

查询上个月的数据

import "date/boundaries"

lastMonth = boundaries.month(month_offset: -1)

from(bucket: "example-bucket")
    |> range(start: lastMonth.start, stop: lastMonth.stop)


Flux的未来

Flux 正在进入维护模式。您可以像现在一样继续使用它,而无需对您的代码进行任何更改。

阅读更多

InfluxDB 3 开源版本现已公开Alpha测试

InfluxDB 3 Open Source is now available for alpha testing, licensed under MIT or Apache 2 licensing.

我们将发布两个产品作为测试版的一部分。

InfluxDB 3 核心,是我们新的开源产品。 它是一个用于时间序列和事件数据的实时数据引擎。 InfluxDB 3 企业版是建立在核心基础之上的商业版本,增加了历史查询能力、读取副本、高可用性、可扩展性和细粒度安全性。

有关如何开始的更多信息,请查看: