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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc0
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:

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

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: