Create dynamic Array and fill with "0" in MongoDB using Talend
Hi everyone,
I'm having some trouble for design a job in Talend using MongoDB components. I have no previous experience in Talend or Mongo technologies.
From source, i need to group data by field FARE and DAY and need create an array with 24 elements (where index in array = hour) to insert each VALUE field in this in this index position specified by HOUR value. This array should be filled with "0" when no record registered in source. I'll show you an example:
This is my source data wtih 3 records.
This records should be grouped in same array and this job should insert in Mongodb one document with this structure.
I've got insert this 3 values into array in mongo, but i'm not sure what strategy or design should to apply for insert values in specific index from this array. I've tried tJavaFlex, tJavaRow, tMap components... with no successful results. Someone could help me with this case??