Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3100

bson_iter_value API is unfriendly

    XMLWordPrintable

Details

    • Task
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      bson_iter_value returns a bson_value_t to the caller, but the returned value is a reference to an internal member of the iterator.  This means that if the iterator gets destroyed, the caller's reference is invalidated.  This also means that if the internal state of the iterator changes (for example, from a second call to bson_iter_value) the first value returned to the caller can be altered underneath them.

       

      Let's design a friendlier API that allows the caller to pass in a bson_value_t* that they control, which can be populated with pointers directly into the underlying bson buffer instead of relying on the bson_iter_t as an intermediary.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              samantha.ritter@mongodb.com Samantha Ritter (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: