-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Server Discovery and Monitoring
-
None
-
Fully Compatible
Per https://docs.mongodb.com/manual/reference/command/isMaster/#isMaster.lastWrite, lastWriteDate is contained in a sub-field of lastWrite, but the go driver attempts to parse lastWriteDate as if it were a top-level field.
This bug exists in 3 places (seems like a separate issue that this logic is duplicated 3 times):
- https://github.com/mongodb/mongo-go-driver/blob/58da8e604dddd89f6c03a5ecf3cb406e646685df/internal/results.go#L24
- https://github.com/mongodb/mongo-go-driver/blob/58da8e604dddd89f6c03a5ecf3cb406e646685df/x/mongo/driver/description/server.go#L124
- https://github.com/mongodb/mongo-go-driver/blob/58da8e604dddd89f6c03a5ecf3cb406e646685df/x/mongo/driver/operation/ismaster.go#L135
Separately, it appears opTime in the lastWrite sub-document is also not parsed, despite "server-discovery-and-monitoring.rst" suggesting they should be parsed out (and presumably made available to clients).