[GODRIVER-894] How to make a decodable costum object id Created: 21/Mar/19 Updated: 11/Sep/19 Resolved: 25/Mar/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 1.0.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Karl Wolffgang | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
go1.12 linux/amd64 |
||
| Description |
|
Is there a way to make ObjectIDs with own methods that can be decoded from a BSON?
But when I use that type instead of the original in a struct and try to decode a BSON I get the following error message:
|
| Comments |
| Comment by Karl Wolffgang [ 27/Mar/19 ] |
|
Hey @Ian Whalen, thank you for the fast answer. Can you give me a small hint on how to implement such a custom codec? I am still relatively new to Go and often have difficulties finding the right start. |
| Comment by Ian Whalen (Inactive) [ 25/Mar/19 ] |
|
karltga indeed you can write a custom codec to do this. |