I tried to query the latest 10 of data, but I only saw from the official documentation how to query the latest 1 of data, has anyone tried it?
|> last()
CodePudding user response:
You need two functions:
Use the sort function with the desc flag set to "true":
|> sort(columns: ["_value"], desc: true)
Then use the limit function to get only 10 rows of the output, which in your case are the 10 latest points since you sorted the output in descending order:
|> limit(n: 10)