Details
-
New Feature
-
Resolution: Done
-
Major - P3
-
3.0.0-rc0
-
None
-
None
Description
Given some document::view sub_doc, it would be nice if the following worked:
auto sub_doc = document{} << "b" << 1 << finalize;
|
auto doc_builder = document{} << "a" << sub_doc.view();
|
Currently, the core builder has no append overload that can take a document::view, so one of these workarounds has to be used:
// build and append a b_document type
|
builder << bsoncxx::types::b_document{sub_doc};
|
|
|
// use the 'concatenate' helper in a new subdoc
|
builder << open_document << concatenate(sub_doc) << close_document;
|
Neither of these is ideal, it would be nice to have append with a document::view just work.