[CDRIVER-1695] libbson's bson-to-json does't allow for round tripping of Javascript type Created: 13/Oct/16 Updated: 27/Oct/16 Resolved: 27/Oct/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | json |
| Affects Version/s: | 1.5.0 |
| Fix Version/s: | 1.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Derick Rethans | Assignee: | Backlog - C Driver Team |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
libbson's bson-to-json converts the BSON Javascript type to just:
(Document with single ```foo``` key). On the way from json-to-bson, there is no way to distinguish this from a (key => string) pair, and hence, libbson does not create a BSON Javascript type. I would suggest to use the "extended JSON"'s serialisation way:
|
| Comments |
| Comment by Bernie Hackett [ 13/Oct/16 ] | |
|
Though it's not documented at https://docs.mongodb.com/manual/reference/mongodb-extended-json/, the extended JSON format for CodeWScope is:
There is no "CodeWithScope" key in the output. |