[CXX-1455] Add JSON-like syntax to construct BSON object Created: 24/Oct/17 Updated: 28/Oct/23 Resolved: 12/Nov/20 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.0, 3.7.0-beta1 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Yoann Couillec | Assignee: | Clyde Bazile III (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | internal-woes | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Epic Link: | CXX-2082 | ||||||||||||||||||||||||||||
| Description |
|
Today in mongo-cxx-driver, there are several ways of constructing a BSON object None of them provides a JSON-like way despite the fact it exists generally to construct JSON documents I propose to use a similar construction to build BSON documents. Then, we will be able to write:
instead of
I started the development of it |
| Comments |
| Comment by Githook User [ 12/Nov/20 ] | |||||||||||||||||||||||||||||||||
|
Author: {'name': 'Clyde Bazile', 'email': '34226620+bazile-clyde@users.noreply.github.com', 'username': 'bazile-clyde'}Message: | |||||||||||||||||||||||||||||||||
| Comment by Clyde Bazile III (Inactive) [ 02/Nov/20 ] | |||||||||||||||||||||||||||||||||
| Comment by Mathias Stearn [ 08/Oct/19 ] | |||||||||||||||||||||||||||||||||
|
You can use macros to get close to that syntax. We should probably either include something like these in the driver, or modify the code to support it with non-macro syntax.
| |||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 09/Aug/18 ] | |||||||||||||||||||||||||||||||||
|
I believe this ticket is a dup of | |||||||||||||||||||||||||||||||||
| Comment by Derick Rethans [ 26/Oct/17 ] | |||||||||||||||||||||||||||||||||
|
Hi, We are interested in having something like this in the bsoncxx part of the driver. Right now, we are working on MongoDB 3.6 support, and can't really dedicate much time on the implementation of this ourselves. We are however, more then happy to have a look at the syntax proposals, and, if you want, have an initial look at your implementation as well. I do however need to mention, that we don't expect to make it into our next 3.3 release due to time pressure. cheers, |