|
The bson.Decoder is responsible for decoding an io.Reader into the provided type.
The steps are as follows:
- Read a full document into a slice of bytes
- Determine if the provided type implements the bson.Unmarshaler interface, if it does call the UnmarshalBSON method and we're done
- Reflect the type and determine the keys that will be filled in, using the struct name and available tags
- Iterate over the available elements and fill in the provided type. For any interface{} values encountered, place a *ReaderElement in that spot.
|