Hi all,
I have the aggregation below:
List< RunInfoUnwindClxNames_UnwindClxParameterList> runDataList = RunDataRepository.GetCollectionObject().Aggregate()
.Match(filter)
.Lookup(
SpecSheetRepository.GetCollectionObject(),
m => m.RunDefinition,
c => c.RunDefinition,
(RunFull m) => m.SpecSheet
)
.Lookup(
IndexGroupRepository.GetCollectionObject(),
m => m.RunDefinition,
c => c.RunDefinition,
(RunFull m) => m.IndexGroupList
)
.Unwind<RunFull, RunFullUnwindClxNames>(m => m.ClxNames)
.Lookup(
BikeClxRepository.GetCollectionObject(),
m => m.ClxNames,
c => c.Name,
(RunFullUnwindClxNames m) => m.ClxParameterList
)
.Unwind<RunFullUnwindClxNames, RunInfoUnwindClxNames_UnwindClxParameterList>(m => m.ClxParameterList)
.Lookup(
BikeClxRepository.GetCollectionObject(),
m => m.ClxParameterList.BaseClxName,
c => c.Name,
(RunInfoUnwindClxNames_UnwindClxParameterList m) => m.ClxParameterList.BaseParamaterValues
)
.ToList();
As you can see I have done 2 $unwind in order to be able to run the following $lookup.
At the end of the aggregation, when I have all the values I want, I would like to un-unwind: an example is below.
The agregation returns me the following list
{ f1: 5 , f2 : 4 , f3 : 10}
{ f1 : 5, f2 : 6 , f3 : 10}
{ f1 : 5, f2 : 9 , f3 : 10}
and I would like to get:
{ f1: 5 , f2 : [ 4 6 9 ] , f3 : 10}
Is this possible?
Regards,
Andrea