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

bsoncxx builders should error when multiple keys are pushed without a value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc0
    • Component/s: BSON
    • Labels:

      Description

      Currently, if multiple keys are pushed to a builder without an associated value, all keys but the last one pushed are ignored.

      Consider the following code snippet, which demonstrates this issue with a stream builder. A user might expect this code snippet to create the document {"foo": "bar", "baz": "quux"}, but instead it creates the document {"baz": "quux"}. To fix this issue, we should change the builders so that an exception is thrown when the "bar" key is attempted to be pushed.

      builder::stream::document doc;
      doc << "foo";
      doc << "bar";
      doc << "baz" << "quux";
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: