I got 3 collections “batches”, “buildAggregations”, “builds”
A batch object got an array with related buildAggregations id
A buildAggregation object got an array with related builds id
I want to fetch all batches with all sublevel objects so I wrote a $lookup command
db.getCollection("batches").aggregate([
{
$lookup:
{
from: "buildAggregations",
localField: "AggregationBuildIdList",
foreignField: "BuildAggregationModelId",
pipeline:[
{
$lookup: {
from: "builds",
localField: "BuildIdList",
foreignField: "_id",
as: "Builds"
}
}
],
as: "AggregationBuilds"
}
}
])
I can’t figure out how I should add a pipeline condition in lookup in C#
MongoDB Compass won’t export this in C# so I’m kind of stuck here