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

bson_iter_value API is unfriendly

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      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.

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

              Created:
              Updated: