[GODRIVER-1769] Collection.FindOne option MaxTime not working Created: 15/Oct/20  Updated: 28/Oct/23  Resolved: 02/Nov/20

Status: Closed
Project: Go Driver
Component/s: Command & Dispatch
Affects Version/s: 1.4.0
Fix Version/s: 1.4.3

Type: Bug Priority: Major - P3
Reporter: 煜廷 許 Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I tried to set a time limit for each mongo operation.
I create a option instance using function `options.FindOne().SetMaxTime()` and pass it to Collection.FindOne(). Somehow, it doesn't seem to work.
So I dig deeper into source code and found out that in `collection.go`
`opt.MaxTime` is not assigned to `findOpt`



 Comments   
Comment by Githook User [ 02/Nov/20 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@mongodb.com', 'username': 'iwysiu'}

Message: GODRIVER-1769 pass MaxTime from FindOne to Find (#525) (#527)
Branch: release/1.4
https://github.com/mongodb/mongo-go-driver/commit/814779dce994efd3e224c9af8de82d1e98c29678

Comment by Githook User [ 02/Nov/20 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@mongodb.com', 'username': 'iwysiu'}

Message: GODRIVER-1769 pass MaxTime from FindOne to Find (#525)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/975f9543869df25b3fd0b23c9e744d976e3019ec

Generated at Thu Feb 08 08:37:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.