I'm trying to write an aggregation in MongoDB which would result as shown below. Please suggest to me how to build MongoDB Aggregation in order to achieve my output.
Collection (input): I would like to add a key test_id to the obj.test_id object based on matching condition test_id.
Please suggest an optimal way of writing a MongoDB query to achieve my result.