Detailed steps to reproduce the problem?
See attached test.go file. When inserting an empty slice, it would previously end up being decoded as nil but after GODRIVER-2914 and https://github.com/mongodb/mongo-go-driver/pull/1323 that now changed and it's now decoded as an empty slice.
Definition of done: what must be done to consider the task complete?
The Release Notes should be updated to denote this change in 1.13.x and an option should be added to restore the old behavior. It should be removed from 1.12.x as I believe it's a breaking change.
The exact Go version used, with patch level:
$ go version
This is happening with 1.22rc1 and 1.21.5.
The exact version of the Go driver used:
$ go list -m go.mongodb.org/mongo-driver
I tested with 1.31.0, 1.31.1, 1.12.0 and every commit in between to determine when it broke.
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
N/A
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
N/A
Security Vulnerabilities
If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here
- is caused by
-
GODRIVER-2914 Improvements in marshaling and compression
- Closed