cnosdb

How can I get a result from http with the same order of cnosdb-cli?


A sql command "Select * From air Limit 1;" for example. When I use it to query in cnosdb-cli, I got result as follow:enter image description here

When I query by http with cmd according to docs. The result is this: enter image description here

It has the same value but different order. I think it is sorted lexicographically. So how can I get a result with the order like cli's result? I always need a result with time as the first field like cli-result.


Solution

  • When I change the accept type to application/csv format, I can get the desired order.Then I convert the return value in csv format into the json format I want. A bit more complicated but usable.