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

XMLWordPrintableJSON

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

      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:
            Samuel Rossi (Inactive)
            Reporter:
            J Rassi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: