Closed larrycinnabar closed 6 years ago
Hi @larrycinnabar
Thanks for the PR - we'll take a proper look but seems like a great change!
Dom
Hi @larrycinnabar
Would you pull the latest development into this branch and we'll get it merged!
Thanks for taking the time to open a PR - it's really appreciated.
Dom
Branch is updated. Also a commit with some extra comments is added
Hi @larrycinnabar
Thanks for taking the time to contribute 👍
Dom
This only works when transforming data to bson to be written into mongo. When reading (populating the struct with) a record I still get the "reflect: indirection through nil pointer to embedded struct" error.
@bojangavrovski hm. Ok, I'm looking into it
BSON encoder doesn't allow to use pointers to struct in
inline
mode.There was an issue on the same topic on old repo: https://github.com/go-mgo/mgo/issues/346
Such structure:
is assumed to become
{"a":0, "m":0}
(withoutmstruct
structure) - the same way asjson
encoder does itwithout fix we get: "reflect: indirection through nil pointer to embedded struct"