[GODRIVER-1793] For nil options, InsertMany and InsertOne have different behaviors Created: 15/Nov/20 Updated: 28/Oct/23 Resolved: 30/Nov/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.4.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | 智 姜 | Assignee: | Kevin Albertson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
mongoDB go driver v1.4.0 |
||
| Backwards Compatibility: | Minor Change |
| Description |
|
To coll.InsertMany(ctx,document, nil), InsertMany will use default options.InsertMany() To coll.InsertOne(ctx, document, nil), InsertOne will panic because opts is [nil], and opt.BypassDocumentValidation will panic for access nil opt.
|
| Comments |
| Comment by Githook User [ 30/Nov/20 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: |
| Comment by Githook User [ 30/Nov/20 ] |
|
Author: {'name': 'jiangzhi', 'email': 'jiangzhi@qiniu.com', 'username': 'jiangz222'}Message: |
| Comment by Githook User [ 30/Nov/20 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: |
| Comment by Kevin Albertson [ 20/Nov/20 ] |
|
PR for tests: https://github.com/mongodb/mongo-go-driver/pull/538 |
| Comment by Githook User [ 20/Nov/20 ] |
|
Author: {'name': 'jiangzhi', 'email': 'jiangzhi@qiniu.com', 'username': 'jiangz222'}Message: |
| Comment by Kevin Albertson [ 18/Nov/20 ] |
|
Thank you for the bug report and contribution jiangz0222@gmail.com! |
| Comment by Divjot Arora (Inactive) [ 16/Nov/20 ] |