[CXX-2130] Add append method for list builder Created: 12/Nov/20  Updated: 28/Oct/23  Resolved: 23/Mar/21

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.0, 3.7.0-beta1

Type: Improvement Priority: Major - P3
Reporter: Clyde Bazile III (Inactive) Assignee: Clyde Bazile III (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently, there's no way to append key-value pairs to a list builder object after construction. We should provide an append method for this case.

Defining an operator+= method will allow users to stick to the JSON-like syntax on the expression's right-hand side. For example:

list::builder doc = {"hello", "world"};
doc += {"foo", "bar"};

instead of

list::builder doc = {"hello", "world"};
doc.append({"foo", "bar"});



 Comments   
Comment by Clyde Bazile III (Inactive) [ 11/Jan/21 ]

https://github.com/mongodb/mongo-cxx-driver/pull/762

Generated at Wed Feb 07 22:04:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.