[GODRIVER-946] Add IndentExtJSON and MarshalExtJSONIndent functions Created: 09/Apr/19 Updated: 02/Nov/21 Resolved: 02/Nov/21 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | 1.8.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | David Bartley | Assignee: | Gabby Asuncion |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Add functions to marshal to pretty printed Extended JSON and to directly marshal to pretty printed Extended JSON. Original Issue: Currently, trying to call json.Marshal on a bson.D results in the document being marshalled as a standard array of structs; i.e. you end up with a JSON array of documents containing "Key" and "Value". I'm aware that the go driver also supports encoding to extended JSON, and that does work, but it's not as usable because it doesn't support indenting/pretty-printing. |
| Comments |
| Comment by Githook User [ 02/Nov/21 ] |
|
Author: {'name': 'Gabriela Asuncion', 'email': 'gabriela.asuncion@mongodb.com', 'username': 'gabbyasuncion'}Message: |
| Comment by David Bartley [ 16/Apr/19 ] |
|
Yes, that would be fine. |
| Comment by Ian Whalen (Inactive) [ 15/Apr/19 ] |
|
bartle would it also satisfy your request if we added pretty-printing for extended JSON? |