[CDRIVER-3368] Audit documentation to make it clear that reply bson_t's should be stack-allocated Created: 16/Sep/19  Updated: 12/Jan/24  Resolved: 12/Jan/24

Status: Closed
Project: C Driver
Component/s: docs, Docs Examples
Affects Version/s: None
Fix Version/s: 1.25.5

Type: Improvement Priority: Minor - P4
Reporter: Samantha Ritter (Inactive) Assignee: Adrian Dole
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Quarter: FY24Q3
Case:

 Description   

Background & Motivation

C driver API which accepts a bson_t* reply expects the reply to be uninitialized. This is inconsistently documented.

mongoc_collection_command_simple notes:

reply: A location to initialize a bson_t. This should be on the stack.

mongoc_database_command_simple notes:

reply: A location to store the commands first result document.

mongoc_client_session_commit_transaction notes:

reply: An optional uninitialized bson_t to receive the server reply, or NULL.

Scope
Audit the documentation for all API methods that take a bson_t* reply and consistently document that the reply must be uninitialized and cannot be the pointer returned by bson_new.



 Comments   
Comment by Githook User [ 12/Jan/24 ]

Author:

{'name': 'Adrian Dole', 'email': 'adrian@dole.tech', 'username': 'adriandole'}

Message: CDRIVER-3368 Consistent bson_t *reply documentation (#1459)

More explicit documentation for bson_t out-params. Audit docs to find where bson_t *reply is actually required.

Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>

---------

Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/da6db59c99873d0ca504820e2a68fc88013e4f26

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