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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.4.0
    • Affects Version/s: None
    • Component/s: Docs, libbson
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            A. Jesse Jiryu Davis
            Reporter:
            Wan Bachtiar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: