Skip to content

CXX-3082 Add examples for bsoncxx::v_noabi::builder::concatenate #1224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 4, 2024

Conversation

eramongodb
Copy link
Contributor

Followup to #1208. Prompted by CXX-2291.

Overlooked the addition of examples of using concatenate(), which are currently only used in error handling examples for sub-document/sub-array exception recovery. Updates documentation of concatenate() overloads to avoid implying their use is specific to the stream builders.

As a drive-by improvement, simplifies creation of arrays for examples by using make_array(args...) instead of going through from_json(R"({"v": [args...]})")["v"].get_array().value. ("When all you have is a hammer, ...")

@eramongodb eramongodb requested a review from kevinAlbs October 3, 2024 21:25
@eramongodb eramongodb self-assigned this Oct 3, 2024
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the readability improvement of using make_array. Suggested rewording concatenate docs.

@eramongodb eramongodb requested a review from kevinAlbs October 4, 2024 18:08
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with other two comments updated.

Comment on lines 91 to 92
/// Use this with a document or array builder to merge an existing document's fields with that of
/// the document or array being built.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Use this with a document or array builder to merge an existing document's fields with that of
/// the document or array being built.
/// Use this with a document builder to merge an existing document's fields with that of the
/// document being built.

Comment on lines 108 to 109
/// Use this with a document or array builder to merge an existing array's fields with that of the
/// document or array being built.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Use this with a document or array builder to merge an existing array's fields with that of the
/// document or array being built.
/// Use this with an array builder to merge an existing array's fields with that of the array being
/// built.

@eramongodb eramongodb merged commit 6e949dc into mongodb:master Oct 4, 2024
66 of 73 checks passed
@eramongodb eramongodb deleted the cxx-3082-bsoncxx branch October 4, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants