01-04-2023 01:25 AM
Hi , currently we have an array that contains more then 100 elements , approximately 168. Is it possible with some transformation in the mapper to create another array that will contain the rest 68 elements ?
We would have 1 array with 100 elements and the other should contain the rest of the elments.
Or we can split the array if there are more then 100 documents , that would work too.
Solved! Go to Solution.
01-09-2023 08:17 AM
01-04-2023 01:43 AM
Hi @Igor_Bozhinovski ,
You can take a look at Group By N snap, I think it will help you with this issue.
You can set Group Size to 100 and you will have two groups as output.
BR,
Marjan
01-04-2023 05:00 AM
Thanks Marjan , the array is part of the object and the Group By N snap doesnt seems to help.
The array looks like this:
SerialNumbers":[
{
“SerialNo”:“123”,
“SerialNo”:“456”,
}
]
Regards,
Igor
01-04-2023 05:15 AM
Hi Igor,
Then maybe Group by fields snap is the one you are looking for?
You can choose by which object to group by.
Let me know if this helps you.
BR,
Marjan
01-04-2023 05:14 AM
@Igor_Bozhinovski - I think @marjan.karafiloski has a great idea here. Use the JSON Splitter to first break the array into individual documents, then use the Group By N snap to regroup them into the size you want. This will handle the case when your array grows beyond 200 so there are no groups that will be larger than 100.