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

bson_init_from_data() missing

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.6.0
    • None
    • libbson
    • None

    Description

      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);
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: