[GODRIVER-800] Modify BatchCursor to return batch as a single slice of documents Created: 31/Jan/19  Updated: 28/Oct/23  Resolved: 11/Feb/19

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: 1.0.0-rc1

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


 Description   

BatchCursor currently returns a batch as a slice of BSON documents one after the other. While this works, it requires copying bytes from their array format into a document sequence.

Add a new type, bsoncore.DocumentSequence, that contains a slice of bytes, boolean indicating if the slice of bytes is a document sequence or a BSON array of documents, and an int32 indicating the position of the start of the next document.

This type should have a Documents method that will return a []bsoncore.Document. This type should also have a Next method which returns a bsoncore.Document and an error.



 Comments   
Comment by Githook User [ 11/Feb/19 ]

Author:

{'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}

Message: Add bsoncore.DocumentSequence for BatchCursor

Add the bsoncore.DocumentSequence type and use it in BatchCursor.

GODRIVER-800

Change-Id: I3b95cce0e7693559d9b79541156622cb1ab3b977
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/ff4c9616124a53a43ac87584f82f98b070bfbe03

Comment by Kristofer Brandow (Inactive) [ 02/Feb/19 ]

Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/443085.

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