SERVER-139180In Progress
Update join path resolver to query types after $match
In agg_join_model.cpp there is this code which determines which pipeline stage to pass into the graph's canPathBeArray: For a subpipeline, we see that the first subpipeline stage is selected. So the call ends up being canPathBeArray("path", <first stage>). {quote}canPathBeArray: Returns false if the path as seen at the input of 'stage' can be proven to not be an array. {quote} This means that the first stage (the $match) will not be considered for type inference, instead returning the t