Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
1.0.2
-
None
-
Docker environment based on Debian Stretch with Go 1.12
Description
I've found that this behaviour could be related to the decoder used by BSON itself when dealing with embeded structs.
Take a look for instance at the behaviour of the following:
https://play.golang.org/p/OBbfb_6jPjH
At the database you would expect to have
{
|
"name":"Hello, playground", |
"alt_name":"This is the stuff" |
}
|
But instead I'm having
{
|
"name":"Hello, playground", |
"mystuff":{ |
"alt_name":"This is the stuff" |
}
|
}
|
Which is counter-intuitive given the standard behaviour for embeded structs and json Decoding
Is this an intended behaviour for Umarshaling/Marshaling or is this a bug?