I make a query to a database of postgres and I bring two fields, "USER" and "CREATED" (DATE)
I extract the year from the creation date, and then it is traversing the records and according to the year and the user create the new json object
And I would like to generate a json with the following structure.:
[
{year:2015,
users[
{
user:"Ana"
created: 4
},
{
user:"Pedro"
created: 7
}
]},
year:2016,
users[
{
user:"Ana"
created: 4
},
{
nombre:"Pedro"
created: 7
}
]}
]
I create a modification with "Modified Java Script Value", I have several doubts, I want to go through an array for each year and each user but I see that in the data below only I can save it as:NUMBRE,STRING,DATA,BOOLEAN,INTEGAR,BIGNUBER,BINARY,TIMESTAMP,INTERNET-ADDRESS.
I do not know how I can generate my json with arrays and objects inside objects.