Details
-
Bug
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
Minor Change
-
ALL
Description
At least C driver under some uses constructs arrays without the field names. We should not silently fail, but rather reject the input.
The BSON Spec is ambiguous, but what it's supposed to say is that a BSON array is encoded like an object, where the field name of each element is the UTF-8 string of the base-10 encoding of the element's position in the array. The first element has field name "0", the second "1", the eleventh "10", and so on.
The validateBSON() method is used by the server in standard operation to validate the incoming BSON adheres to the spec, and we should extend its implementation to also validate array field names.