[CSHARP-311] New serialization format for Dictionary<TKey, TValue> as array of nested documents Created: 29/Aug/11  Updated: 02/Apr/15  Resolved: 06/Oct/11

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.3

Type: New Feature Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.


Generated at Wed Feb 07 21:36:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.