|
Currently the way a Cursor is implemented the DecodeBytes method returns the bytes directly from the slice underlying the cursor. While this is a slice allocated for the wire message response, it can be large since we use one slice for all of the documents returned from the cursor. Adding a AppendDecodeBytes or DecodeBytesAppend method that takes a []byte would allow users to not have to do a copy themselves when they want bytes. This method would work similar to the other Append methods where the bytes are copied into the slice and the slice is grown if the capacity is not large enough.
|