Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2130

Add append method for list builder

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.7.0, 3.7.0-beta1
    • None
    • None
    • None

    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"});
      

      Attachments

        Activity

          People

            clyde.bazile@mongodb.com Clyde Bazile III (Inactive)
            clyde.bazile@mongodb.com Clyde Bazile III (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: