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

libbson: bson_value_t example on the reference page needs an update.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.4.0
    • None
    • docs, libbson
    • None

    Description

      The example usage for bson_value_t listed in :

      https://api.mongodb.org/libbson/current/bson_value_t.html

      is using value not as a pointer. Also it should have used value->value_type instead of value->type.

      const bson_value_t *value;
      value = bson_iter_value (&iter);
      if (value->value_type == BSON_TYPE_INT32) {
         printf ("%d\n", value->value.v_int32);
      }
      

      https://github.com/mongodb/libbson/blob/master/doc/bson_value_t.page

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            wan.bachtiar@mongodb.com Wan Bachtiar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: