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: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • Service Arch 2024-04-01, Service Arch 2024-04-15, Service Arch 2024-04-29, Service Arch 2024-05-13

      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: