[CDRIVER-1151] libbson: bson_value_t example on the reference page needs an update. Created: 10/Mar/16  Updated: 10/Aug/16  Resolved: 18/Apr/16

Status: Closed
Project: C Driver
Component/s: docs, libbson
Affects Version/s: None
Fix Version/s: 1.4.0

Type: Bug Priority: Minor - P4
Reporter: Wan Bachtiar Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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



 Comments   
Comment by Githook User [ 18/Apr/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1151 fix bson_iter_value example
Branch: master
https://github.com/mongodb/libbson/commit/ab2ee5ba73c6e38263bfd6de892c0e22b128a809

Comment by A. Jesse Jiryu Davis [ 10/Mar/16 ]

Thanks!

Generated at Wed Feb 07 21:11:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.