The following example will cause the IDL compiler to generate C++ code which fails to compile
enums: QueryPlanRankerMode: type: string values: kAutomaticCE: "automaticCE" kHistogramCE: "histogramCE" kSamplingCE: "samplingCE" kMultiPlanning: "multiPlanning" server_parameters: planRankerMode: description: "Enable cost-based ranking of query plans." set_at: [ startup, runtime ] cpp_varname: planRankerMode cpp_vartype: synchronized_value<QueryPlanRankerModeEnum> default: expr: QueryPlanRankerModeEnum::kAutomaticCE redact: false
The current workaround is to generate the server parameter as a cpp_class, implement an append and setFromString function and access it at runtime using ServerParameterSet::getNodeParameterSet().
This feature request will improve the usable of IDL. I've run into two cases in the past month where this would be useful.
- is depended on by
-
SERVER-93315 Delete src/mongo/db/query/framework_control.cpp
- Blocked
-
SERVER-96802 Update server param types of IDL Enum to use new IDL syntax
- Open