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

bson_init_from_data() missing

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.6.0
    • Affects Version/s: None
    • Component/s: libbson
    • None

      There is no bson_init_from_data() counterpart for bson_new_from_data(). Please note, however, that there is bson_init_from_json() for its bson_new_from_json() sibling in case of JSON.

      In other words, there is no effective way to initialize a pre-allocated bson_t from a raw data buffer similar to bson_init_from_json(). The only feasible way now is to use a temporary which is sloppy:

      bson_t bson;
      bson_copy_to(bson_new_from_data(data, length), &bson);
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            neoxic Arseny Vakhrushev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: