-
Type:
New Feature
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
The bson.Array type sits on top of the bson.Document type. Since almost nothing stores this type directly, the methods of the bson.Array type must leave the underlying bson.Document in a writeable state after each method call. This means that the Prepend and Delete methods will be especially expensive since they might have to touch every element. The Lookup and ElementAt methods are essentially the same method.
When any of the methods are provided with an element, they need to rewrite that element's key to be the proper index into the array.