Hi ,
I have created an aggregation pipeline which will gives output with 3 columns and a row. How do I convert this to rows, like key value pair?
Name Total Count
------- ------- --------
Product 5 10
I would like to display the above output as all rows
Key Vaue
-------- --------
Name Product
Total 5
Count 10
I tried to use the ‘$objectToArray’, tried to convert the output to array and convert them to Key value pair. I am struck in this. Please advise me the approach for this
Thanks,
Vijay