[CXX-1150] bsoncxx builders should error when multiple keys are pushed without a value Created: 01/Dec/16  Updated: 14/Feb/17  Resolved: 07/Feb/17

Status: Closed
Project: C++ Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Samuel Rossi (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


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



 Comments   
Comment by Githook User [ 07/Feb/17 ]

Author:

{u'username': u'saghm', u'name': u'Saghm Rossi', u'email': u'saghmrossi@gmail.com'}

Message: CXX-1150 bsoncxx builders should error when multiple keys are pushed without a value
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/c6b9df21d7a8710367b981ddd5b46ff10ef26a73

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