[CXX-1151] bsoncxx::builder::core::view_document() and bsoncxx::builder::core::view_array() should throw when builder top-level BSON datum type is incorrect Created: 01/Dec/16  Updated: 16/Dec/16  Resolved: 16/Dec/16

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: J Rassi
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change

 Description   

bsoncxx::builder::core::extract_document() throws bsoncxx::exception when called on a builder where the top-level BSON datum type is an array. Similarly, bsoncxx::builder::core::extract_array() throws when called on a builder where the top-level BSON datum type is a document.

bsoncxx::builder::core::view_document() and bsoncxx::builder::core::view_array() should similarly throw in these error cases.



 Comments   
Comment by Githook User [ 16/Dec/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1151 Add builder::core::view_document()/view_array() error case

For parity with core builder methods extract_document() and
extract_array(), the view_document() and view_array() methods now
throw when the builder top-level BSON datum type does not match.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/a3b589e1c4dbd6ba5a70cebc8ef06a5f0d7eb168

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