Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1503

Support returning sub-documents as values

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Not planned
    • Component/s: BSON, Performance
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            acm Andrew Morrow
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: