Is the array of channels/datastreams in a xively feed always ordered the same way?

StackOverflow https://stackoverflow.com/questions/23458565

  •  15-07-2023
  •  | 
  •  

문제

When retrieving historical data of a feed on xively I get JSON including an array of datastreams, each containing an array of values (called datapoints). Each datastream has an id, for example CO_00-00-aa-e8-a1-b8_1 (redacted). Instead of using this long-form id is it safe to use the array index? I.e. will the first channel in datastreams always be the first channel in datastreams?

도움이 되었습니까?

해결책

The general answer is no. You should not presume the order of datastreams.

From what I remember they were sorted either alphabetically or based on update timestamp. I know it's a little tricky with the AQE, as the datastream names contain MAC addresses... You might find the AQE app source code quite helpful.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top