Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-88024

IDLParser can use incorrect context in generating error messages

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc9
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • v8.0
    • Service Arch 2024-04-01, Service Arch 2024-04-15, Service Arch 2024-04-29, Programmability 2024-05-27, Programmability 2024-06-10

      An example:

      A create command for clustered collections has the following format:

      {
          create: <coll name>
          clusteredIndex: {
              key: <doc>
              unique: <bool>
          }
      }
      

      If I try to create a clustered collection but I forget the unique field I get this error message, which is misleading:

      > db.runCommand({create: 'cc', clusteredIndex: {key: {_id: 1}}})
      {
      	"ok" : 0,
      	"errmsg" : "BSON field 'create.unique' is missing but a required field",
      	"code" : 40414,
      	"codeName" : "IDLFailedToParse",
      	...
      }
      

      The field clusteredIndex.unique is missing, not create.unique.

            Assignee:
            alex.li@mongodb.com Alex Li
            Reporter:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: