-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal, Wire Protocol
-
None
The method CommandMessage#getCommandDocument assumes there is only one additional Kind 1 (Document Sequence) Section in an OP_MSG. But in the new bulk write API there will be two such sections, one for ops and one for nsInfo. And in general, OP_MSG supports any number of Kind 1 Sections.
Let's change this method to support any number of Document Sequence Sections so that it will work properly with the new bulk write API, and any future changes that may require more than two Document Sequence Sections.
This will require some refactoring of ByteBufBsonDocument as well.