-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Service Arch 2022-11-28, Service Arch 2022-12-12
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
https://github.com/mongodb/mongo/blob/master/src/mongo/idl/generic_argument.idl Lists generic argument fields that may be present in all command BSON, and generic reply fields that all command reply BSON may contain.
Today, these lists are special one-off IDL types that are used to generate lookup tables that allow the IDL marshalling and demarshalling code to ignore these fields. This means that there are no C++ representations of these generic argument/reply fields, and all code that wants to append such fields to a command or parse them from a reply must operate on BSON directly.
To allow a command-invoking API to use well-structured types instead of BSON to represent commands and replies, we'll need to also have a type that represents the generic fields we want to attach to the command and a type that represents the generic fields present in the reply. Let's teach the IDL compiler to generate C++ structures for these generic argument and reply fields.
Acceptance criteria:
Generate C++ structures with setters and getters for the generic argument fields and generic reply fields. For now, allow these fields to be of any type. Maintain the existing C++ public API for these fields - i.e. provide a way for code to lookup if a field is a generic argument or reply field, and the forward_{to,from}_shards value of that field.