Forum Discussion
What if we want to create different groups with similar field of similar size. For instance, if there is a field called ‘id’ with value ‘5’ and it occurs 20 times in an input, can we create 4 groups out of it with each group containing 5 values. If it were 22, it should create 5 groups.
You can try with:
After grouping the records by field, to have child pipeline that will receive each group of records, will split, and then using the Group by N Snap to group the records again with specifying the group size.
Regards,
Spiro Taleski
Hello @Spiro_Taleski Thank you for suggesting this.
This seems to be the quickest and the simplest solution to get this done.
Thanks,
Tanmay
Thanks for the response.
If I do your suggestion, the output would be:
[
{
“rootdoc”:
{
“fieldname1”:VALUE1
}
},
{
“rootdoc”:
{
“fieldname1”:VALUE2
}
}]
But, I would rather want the following output:
[
{
“rootdoc”:
[{
“fieldname1”:VALUE1
},
{
“fieldname1”:VALUE2
}]
}]