How can transpose mongodb document list to tabular form?
Example:
I have the following list of BsonDocuments
[0] = { "_id" : ObjectId("546ce80d43f5c2b7d8a713bd"), "Address" : "61- A, Pocket- C, Ram Vihar Phase II, UP", "Pincode" : 110091, "Locality" : "Mayur Vihar Phase II", "City" : "Delhi", "Latitude" : 28.618156, "Longitude" : 76.3055877 }
[1] = { "_id" : ObjectId("546ce80d43f5c2b7d8a713bd"), "Address" : "61- A, Pocket- C, Phase II, Rahi", "Pincode" : 110091, "Locality" : "Mayur Vihar Phase II", "City" : "Delhi", "Latitude" : 28.618156, "Longitude" : 77.305877 }
[2] = { "_id" : ObjectId("546ce80d43f5c2b7d8a713bd"), "Address" : "6 B2C - C, Krish Marg II, Delhi", "Pincode" : 110092, "Locality" : "Mayur Vihar Phase II", "City" : "Delhi", "Latitude" : 28.618156, "Longitude" : 76.305877 }
And I want convert this list to tabular like json like
Address:{'61- A, Pocket- C, Ram Vihar Phase II, UP',' '61- A, Pocket- C, Phase II, Rahi ','6 B2C - C, Krish Marg II, Delhi'} ,
Pincode:{'110091','110091','110092'},
...
Similarly for all fields.
So my question is: is there any library or do I need write code for this?