I have a collection of objects that contain a dictionary, and would like to extract only the keys and not the values in the dictionary (which are much larger than the keys, unlike in the example below) I am using MongoDb.Driver 2.10 for C#.
Assuming I have the following collection:
{ "_id" : "1", "Contents":{"item11":{}, "item12":{} } },
{ "_id" : "2", "Contents":{"item21":{} } },
{ "_id" : "3", "Contents":{"item31":{}, "item32":{}, "item33":{} } }
I would like a query that returns the following:
{ "1": ["item11", "item12"],
"2": ["item21"],
"3": ["item31", "item32", "item33"] }