-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.1
-
Component/s: None
-
None
Currently Dictionary<TKey, TValue> is serialized as one of two forms:
1. A document where the element names are the dictionary key values (only possible when TKey is string)
2. An array of nested two-element arrays containing key value pairs
The second representation is perfectly adequate for serialization/deserialization, but it is difficult to query against. To better support querying the following alternate representation is proposed:
{ 'dictionary' : [
{ 'k' : key1, 'v' : value1 }, ...] }
This representation uses a nested document for the key/value pairs instead of a nested two-element array. This facilitates querying against either the keys or the values.
There should also be a serialization option to allow the developer to choose the second representation even when TKey is string.