• Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • RSS Sydney
    • ALL

      https://github.com/mongodb/mongo/blob/0a68308f0d39a928ed551f285ba72ca560c38576/src/mongo/db/catalog/index_key_validate.cpp#L426-L441

      I think line 439 should be IndexDescriptor::kHiddenFieldName, not IndexDescriptor::kIndexNameFieldName

              } else if (IndexDescriptor::kIndexNameFieldName == indexSpecElemFieldName) {
                  if (indexSpecElem.type() != BSONType::String) {
                      return {ErrorCodes::TypeMismatch,
                              str::stream()
                                  << "The field '" << IndexDescriptor::kIndexNameFieldName
                                  << "' must be a string, but got " << typeName(indexSpecElem.type())};
                  }
      
                  hasIndexNameField = true;
              } else if (IndexDescriptor::kHiddenFieldName == indexSpecElemFieldName) {
                  if (indexSpecElem.type() != BSONType::Bool) {
                      return {ErrorCodes::TypeMismatch,
                              str::stream()
                             // HERE - I think this message should refer to kHiddenFieldName
                                  << "The field '" << IndexDescriptor::kIndexNameFieldName
                                  << "' must be a bool, but got " << typeName(indexSpecElem.type())};
                  }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.alder@mongodb.com Jeff Alder
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: