[GODRIVER-1229] Laxing bson "omitempty" Created: 12/Aug/19 Updated: 27/Feb/23 Resolved: 27/Feb/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | khoa pham | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | mgocompat | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
This is from golang std json:
bson "omitempty" tag should do the same behavior as json so that we could reduce the number of pointers in decoding struct types. Example: struct below
won't work with this "bson" data:
but will work fine with golang std json: https://play.golang.org/p/q-Wnr81Pu3b |
| Comments |
| Comment by Matt Dale [ 27/Feb/23 ] |
|
I'm unable to reproduce this issue using the latest version of the Go Driver BSON library (v1.11.2) See an attempt at reproducing it here: https://go.dev/play/p/jkHO0lzDljq Closing this as can't reproduce. |