[CXX-1137] Alternative interface via nlohmann/json Created: 19/Nov/16  Updated: 19/Aug/20  Resolved: 19/Aug/20

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

Type: New Feature Priority: Minor - P4
Reporter: Joey Andres Assignee: Clyde Bazile III (Inactive)
Resolution: Duplicate Votes: 0
Labels: internal-woes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CXX-1455 Add JSON-like syntax to construct BSO... Closed
Related
related to CXX-1455 Add JSON-like syntax to construct BSO... Closed
Epic Link: CXX-2082

 Description   

nlohmann/json would be a superior bson interface compared to the current stream. It takes advantage of c++11, allowing for something like this:

json j2 = {
  {"pi", 3.141},
  {"happy", true},
  {"name", "Niels"},
  {"nothing", nullptr},
  {"answer", {
    {"everything", 42}
  }},
  {"list", {1, 0, 2}},
  {"object", {
    {"currency", "USD"},
    {"value", 42.99}
  }}
};



 Comments   
Comment by Niels Lohmann [ 28/Feb/17 ]

Ok, then I misunderstood,

Comment by David Golden [ 28/Feb/17 ]

Hi, Niels. Thanks for checking in with us. Someone is asking for us to implement an API like yours, but we're not actually using your library directly. So, I'd say take it as a great compliment that someone likes your stuff, but we don't have any specific need for help at this time.

Comment by Niels Lohmann [ 28/Feb/17 ]

Hi, I am the developer of nlohmann/json. Is there anything I can do to help you with this issue?

Comment by Andrew Morrow (Inactive) [ 28/Nov/16 ]

Note that you can get quite close to this syntax when using the basic builder:

Comment by David Golden [ 19/Nov/16 ]

Thanks for the suggestion. I'm not sure we'll put resources towards this any time soon, but it's definitely a nice syntax to aspire to.

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