I am trying to create a JSON object such as
{
"measure": camera_name,
"interval_s": 7 * 24 * 60 * 60,
"data": [
[done_at, action],
[done_at, action],
[done_at, action]
]
}
my current object is an array from which I want to achieve the above one.

here is the situation: my array object has many objects as in picture am only showing one object, and there are going to be many logs in one object and I want to loop through this as well to set the in "data". the resulting json object will be something as
{
"measure": camera_name,
"interval_s": 7 * 24 * 60 * 60,
"data": [
[done_at, action],
[done_at, action],
[done_at, action]
]
},
{
"measure": camera_name,
"interval_s": 7 * 24 * 60 * 60,
"data": [
[done_at, action],
[done_at, action],
[done_at, action]
]
}
How i can achieve that? I can loop through data but I have no idea how to store such json object. any help will be thankful