[CXX-1503] Support returning sub-documents as values Created: 26/Jan/18  Updated: 30/Jun/23

Status: Backlog
Project: C++ Driver
Component/s: BSON, Performance
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CXX usability improvements

 Description   

Currently, we frequently need to make copies of BSON data, because we have no way to return a document::value that owns the document, but has a view into a sub-document. If we did, we could do better in situations like this:

https://github.com/mongodb/mongo-cxx-driver/compare/163227b2753371ff492520c7415df85dfe3b2795...f3e98#diff-0126c1323c6b3fc61cf2eb5c75bd28bfR118

Here, we have a complete BSON result, but we want to return a document::value that is only a sub-section of the document, for a given field. Since right now you can't have a document::value that owns the whole bson document, but views only a subset, we have no choice but to copy the relevant subset to a new document.


Generated at Wed Feb 07 22:02:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.