2

i have a problem.

I would like to get a list of data but has some same values that i would like to get rid of.

This is a list of a alerts turned on and off, some times i get a "falseTick" and store this data, i need to make a history of this but i can't just get the amount of true values becouse maybe some of this "true" is a "falseTick".

This is the example of data that i index into elastic:

[
  { id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:38 pm },
  { id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:37 pm },
  { id: "asdfghjkl", value: false, date: July 24th 2020, 12:18:36 pm },
  { id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:35 pm },
  { id: "asdfghjkl", value: false, date: July 24th 2020, 12:18:34 pm },
  { id: "asdfghjkl", value: false, date: July 24th 2020, 12:18:33 pm },
]

and this is what i would like to get

[
  { id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:38 pm },
  { id: "asdfghjkl", value: false, date: July 24th 2020, 12:18:36 pm },
  { id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:35 pm },
  { id: "asdfghjkl", value: false, date: July 24th 2020, 12:18:34 pm }
]

Real Tick Example:

Sensor connect and record the current value "false" > 
addElastIndex({ id: "asdfghjkl", value: false, date: July 24th 2020, 12:18:38 pm }) > 
Sensor detect a change "true" > 
addElastIndex({ id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:38 pm })

False Tick Example:

Sensor connect and record the current value "true" > 
addElastIndex({ id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:38 pm }) > 
Sensor dissconnects >
Sensor connect and record the current value "true" > 
addElastIndex({ id: "asdfghjkl", value: true, date: July 24th 2020, 12:18:38 pm })   # This value should be considered a falseTick becouse wasn't a real True, becouse wasn't detected by the sensor

0 Answers0