influxdata / influxdata/influxdb

Need to get the latest data

Open
#24,023 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Need to get the latest data

Can I query the latest 30 pieces of data without adding time, because the device may be offline for 3 days or more, and the time is uncertain

from(bucket: "abc")
|> range(start: -3d)
|> filter(fn: (r) => r["addr"] == "123456")
|> tail(n: 30)
|> difference()

Contributor guide

Open the contributing guide

Research direction

Start with the Flux query in the issue, especially its range, tail, and difference operations. Determine whether the requested latest-30 behavior can be defined without a time bound, and document what successful behavior should be for devices offline for several days.

Written by the indexing model from the issue text.

Assessment

Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.