This reverts commit 9c16f9da5a.
Fixing struct tag values is causing some tests to fail. An issue has
been opened internally which talks in depth about the issue.
Prevents a situation where when attempting to decode a string into a nil
interface, the decoded value would be the encoded slice of bytes instead
of the string we need.
- Converting directly from a D to an M is deprecated. We are now decoding
directly in a M.
- Used errors.As and errors.Is for proper error comparison and assertion
- Streamlined function parameters and removed redundancies
- Revised sloppy reassignments and added missing error checks
- Shortened and reorganized function structure for improved readability
Remove the custom time decoder used for mongo BSON
datetime values. The custom decoder was only converting these values
into UTC and was not any different from the default time.Time
decoder in the MongoDB driver, which also handles BSON string, int64,
and document values.
- Set (but comment) serverAPI options (currently distinct api and
create.size BSON field are deprecated + possible others that are untested)
- Rename and refactor 'TimeDecodeValue1' to 'decodeTimeValue', add
nil case handling
- Implement 'buildURL' function to connect to mongo (can also be
used for mysql and postgres)
- Update function names, variable names, and comments for clarity
- Replace 'bsonx.Regex' with the Regex primitive for v1.12 compatibility
- Use simple concatenation instead of Sprintf
- Declare 'timeType' locally, replace global 'tTime'
- Use 'RegisterTypeDecoder' to replace deprecated 'RegisterDecoder'
- Simplify several functions without altering functionality
- Remove redundant 'storageType' field in 'mongoStorage',
use 'isDataDB' instead