Details
-
Improvement
-
Status: Closed
-
Minor - P4
-
Resolution: Fixed
-
None
Description
Today in mongo-cxx-driver, there are several ways of constructing a BSON object
http://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/working-with-bson/
None of them provides a JSON-like way despite the fact it exists generally to construct JSON documents
https://github.com/nlohmann/json
I propose to use a similar construction to build BSON documents. Then, we will be able to write:
document friends {{"friend",{{"_id", json::id{}}, |
{"name","jean"}, |
{"dob",1970}}}}; |
instead of
bsoncxx::document::value = document{} << "friends" << open_document |
<< "_id" << bsoncxx::oid() |
<< "name" << "jean" |
<< " dob" << 1970 |
<< close_document
|
<< finalize;
|
I started the development of it
Attachments
Issue Links
- depends on
-
CXX-2067 Expose bson_value::value type constructors
-
- Closed
-
- is duplicated by
-
CXX-1137 Alternative interface via nlohmann/json
-
- Closed
-
-
CXX-1294 Add new free functions to assist in efficient subdocument/subarray building with the basic builder
-
- Closed
-
- is related to
-
CXX-1137 Alternative interface via nlohmann/json
-
- Closed
-