-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
Fully Compatible
-
ALL
-
Service Arch 2023-11-13, Service Arch 2023-11-27
When a variant IDL type contains an array, it will generate code like this (from query_settings_gen.cpp, the indexHints field)
const BSONType variantType = element.type(); switch (variantType) { case Array: if (element.Obj().isEmpty()) { std::uint32_t expectedFieldNumber{0}; const IDLParserContext arrayCtxt(kIndexHintsFieldName, &ctxt, ctxt.getTenantId(), getSerializationContext()); std::vector<mongo::query_settings::IndexHintSpec> values; const BSONObj arrayObject = element.Obj(); for (const auto& arrayElement : arrayObject) { [...elided...] ++expectedFieldNumber; } _indexHints = std::move(values);
The arrayObject is empty, so the "for" loop, all the code in it, the expectedFieldNumber, and 'values' are not useful. _indexHints will be set to an empty array every time.