[GODRIVER-482] Separate command.Command into command.Read and command.Write Created: 02/Jul/18  Updated: 28/Oct/23  Resolved: 09/Jul/18

Status: Closed
Project: Go Driver
Component/s: Command & Dispatch
Affects Version/s: 0.0.8
Fix Version/s: 0.0.9

Type: Improvement Priority: Major - P3
Reporter: Kristofer Brandow (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
is depended on by GODRIVER-483 Push down handling of Unacknowledged ... Closed
Related
is related to GODRIVER-52 Implement Drivers Sessions API Closed
is related to GODRIVER-54 OP_MSG support Closed

 Description   

Currently command.Command is used as the base level command to send to a server. During the implementation of OP_MSG additional properties were added to command.Command that make it much more difficult to use, mainly the Acknowledged property which should default to true.

Additionally, the command package will eventually be used as a proxy or server implementation, which means it needs to be able to decode driver requests. The current command.Command can handle this but has no path to transform into another command type, such as command.Insert. When the proxy and server components of the networking library are created, there will be a need for a new type that can handle this decode path.

To enable a more usable command package and to make space for the networking library improvement split command.Command into command.Read and command.Write. The command.Read type will take the *readpref.ReadPref property from command.Command and the command.Write type will have a *writeconcern.WriteConcern property.

Further, the mongo package should handle extracting the *writeconcern.WriteConcern option and the *readpref.ReadPref and attaching them to the correct command type.

In the future, when the networking library's proxy and server components are being developed, the command.Command type can be recreated to handle the functionality described above.



 Comments   
Comment by Roland Fong [ 09/Jul/18 ]

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

Comment by Githook User [ 09/Jul/18 ]

Author:

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

Message: Implement the OP_MSG specification.

GODRIVER-54
GODRIVER-482
GODRIVER-483

Change-Id: Ida787c1005d17f0a8bae5993cbc5e72665e8daae
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/88e57ff579da3574564a9edcccdb6278cc32ce25

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