-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Unknown
-
Affects Version/s: 2.0.0
-
Component/s: Extended JSON, JSON & ExtJSON
-
None
-
Go Drivers
-
Not Needed
Detailed steps to reproduce the problem?
Run https://gist.github.com/AlekSi/c2f20c5f6dfa86115be5453b746f47a4
See this:
Marshalled
bson.D{bson.E
Unknown macro: {Key}, bson.E{Key:"regex", Value:bson.Regex
Unknown macro: {Pattern}}}
as
{"string":"\"","regex":{"$regularExpression":
Unknown macro: {"pattern"}}}
Note that the double quote symbol is escaped inside the string but not inside regex. The generated JSON is invalid because of that.
Definition of done: what must be done to consider the task complete?
The generated JSON should be valid.
The exact Go version used, with patch level:
$ go version
go version go1.23.5 darwin/arm64
The exact version of the Go driver used:
$ go list -m go.mongodb.org/mongo-driver
go: module go.mongodb.org/mongo-driver: not a known dependency
The right command is "go list -m go.mongodb.org/mongo-driver/v2":
go.mongodb.org/mongo-driver/v2 v2.0.0
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, ...)
Doesn't matter.
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