[GODRIVER-3080] FindOneAndUpdate with options.After is not returning the updated document Created: 28/Dec/23 Updated: 18/Jan/24 |
|
| Status: | Scheduled |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | 1.13.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Wen Riccardi-Zhu | Assignee: | Matt Dale |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
Detailed steps to reproduce the problem?Include full traceback, if possible I've taken over a project that has a method like the following: func (o *Object) UpdateRemovePrimaryImage() error { fmt.Println("before db", o.PrimaryImage) return nil That method calls this function: func UpdateFields(col, id string, fields, res interface{}) error { filter := bson.D{{Key: "id", Value: id}} return nil In the terminal, this is outputted: This isn't how I would do things, but I'm surprised that the original document is being returned. Is this expected behavior? Definition of done: what must be done to consider the task complete?The exact Go version used, with patch level:$ go version go version go1.21.5 linux/amd64 The exact version of the Go driver used:$ go list -m go.mongodb.org/mongo-driver go.mongodb.org/mongo-driver v1.13.1 Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.M10 hosted on Atlas, 7.0.4. The operating system and version (e.g. Windows 7, OSX 10.8, ...)Linux 6.6.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 14 Dec 2023 03:45:42 +0000 x86_64 GNU/Linux Security VulnerabilitiesIf you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here |
| Comments |
| Comment by PM Bot [ 28/Dec/23 ] |
|
Hi dwrz@museumexchange.com, thank you for reporting this issue! The team will look into it and get back to you soon. |