Details
-
Improvement
-
Resolution: Done
-
Minor - P4
-
None
-
None
-
None
-
None
-
.Net
-
Major Change
Description
Could we de-serialize arrays as ArrayList or List? In Javascript, an "Array" behaves like a .Net ArrayList or List. Furthermore, the behavior of deserialization is somewhat non-deterministic as the programmer can really only count on getting an IEnumerable as opposed to a working collection. This is especially the case with mixed types, where the programmer would usually get an object[], but might get an int[] or string[].
This would be a breaking change, but it would be worth it.
------------
A potential way to do it is (in BsonReader.cs):
private Object ConvertToArray (Document doc)
{ List<object> ret = new List<object>(); foreach (String key in doc.Keys) ret.Add(doc[key]); return ret; }--------------
(Note: I'm trying to keep my local branch as close as possible to the master, so I'm keeping this out of my local branch.)