[GODRIVER-1108] Operation.addReadConcern encodes "empty" ReadConcern Created: 04/Jun/19  Updated: 28/Oct/23  Resolved: 14/Jun/19

Status: Closed
Project: Go Driver
Component/s: Core API
Affects Version/s: None
Fix Version/s: 1.1.0

Type: Bug Priority: Major - P3
Reporter: Eric Daniels (Inactive) Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

ReadConcern is rarely nil and is instead usually a zero valued struct when created by a default client. The old code for addReadConcern used to check if the encoded result had a length of non-zero before adding it to the document. This check is gone and an empty document is encoded. This same check could be added back or a different check can be done to optimize performance where we don't need to marshal.



 Comments   
Comment by Githook User [ 14/Jun/19 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: Do not encode empty read concern for operations.

GODRIVER-1108

Change-Id: I8d7ce7b4e730903c0095ab76c332c81a989b4ad6
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/d4dabd406d094a85504a281c87e4c7d82b694577

Comment by Divjot Arora (Inactive) [ 07/Jun/19 ]

CR: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/457314

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