|
While this initially sounds like a good idea I don't think we should do this, for several reasons:
1. It is not visually distinctive from just adding items to the array:
var array = new BsonArray { "a", 1, "b", 2, { "c", 3 }, "d", 4 }; // looks very much like an 8-element array
|
2. It only works for nested documents that have exactly one element
var array = new BsonArray { new BsonDocument { { "x", 1 }, { "y", 2 } } }; // no way to do this with the proposed syntax
|
3. It doesn't generalize to nested arrays
var array = new BsonArray { 1, 2, [3, 4], 5}; // invalid syntax
|
|