[16:55:52] <tpr> hi, when doing conditional projections in the aggregation pipeline, is there a way to reference the current "scope" for the the outputed when using conditionals? I have a list of results, which contain similarly named fields, and I'd like to project them based on a variable inside the object
[16:57:07] <tpr> https://bpa.st/6AIA is a shortish example, using the $cond works fine, but the "then" expression gets evaluated for the whole list of results, instead of the matched one
[17:30:24] <tpr> hmm, looks like filtering with condition, and adding a new pipeline step and using arrayElemAt would do the trick :P
[17:31:19] <tpr> the last answer at https://medium.com/techuniverse/mongodb-aggregation-example-extracting-a-specific-field-of-an-array-element-with-matching-d832eeef2cdf
[17:41:24] <tpr> weehaa, and then simply addFields and ignore the original object :-)