[GODRIVER-475] Add to Cursor a way to append document bytes to a slice Created: 21/Jun/18  Updated: 27/Oct/23  Resolved: 24/Jul/20

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: 0.0.7
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-474 Expose Cursor.Peek() function to know... Closed

 Description   

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.


Generated at Thu Feb 08 08:34:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.