[GODRIVER-1450] BulkWriteError's request is not the correct one Created: 19/Dec/19  Updated: 28/Oct/23  Resolved: 19/Dec/19

Status: Closed
Project: Go Driver
Component/s: Error Handling
Affects Version/s: 1.2.0
Fix Version/s: 1.2.1

Type: Bug Priority: Major - P3
Reporter: emilien puget Assignee: Go Community User
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongo 3.4



 Description   

When initializing the BulkWriteError, the document set is not the correct one, the first document of the batch is used instead, it should used the document in the batch at the index returned by the WriteError (https://github.com/mongodb/mongo-go-driver/blob/b414b897457665f12997cefd10ad934ccb9dfb3e/mongo/errors.go#L129)

https://github.com/mongodb/mongo-go-driver/blob/b414b897457665f12997cefd10ad934ccb9dfb3e/mongo/bulk_write.go#L156

 

 



 Comments   
Comment by Divjot Arora (Inactive) [ 19/Dec/19 ]

Merged the PR into master and release/1.2 branches.

Comment by Githook User [ 19/Dec/19 ]

Author:

{'name': 'emilien puget', 'email': 'emilien-puget@users.noreply.github.com', 'username': 'emilien-puget'}

Message: GODRIVER-1450 : use correct writeModel in BulkWriteError (#263)
Branch: release/1.2
https://github.com/mongodb/mongo-go-driver/commit/c255636decc80aa6123d01784ac8e22a189af719

Comment by Githook User [ 19/Dec/19 ]

Author:

{'name': 'emilien puget', 'email': 'emilien-puget@users.noreply.github.com', 'username': 'emilien-puget'}

Message: GODRIVER-1450 : use correct writeModel in BulkWriteError (#263)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/a0319a6f9fb977eeba1d69dc221b8f0c5b356264

Comment by emilien puget [ 19/Dec/19 ]

i made a pr for this here https://github.com/mongodb/mongo-go-driver/pull/263

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